summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/new.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 defaultNemanja Ivanovic2019-02-051-1/+1
| | | | | | | | | | | When Clang/LLVM is built with the CLANG_DEFAULT_STD_CXX CMake macro that sets the default standard to something other than C++14, there are a number of lit tests that fail as they rely on the C++14 default. This patch just adds the language standard option explicitly to such test cases. Differential revision: https://reviews.llvm.org/D57581 llvm-svn: 353163
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-6/+6
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-6/+6
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* Switch to gnu++14 as the default dialect.Tim Northover2017-12-091-2/+0
| | | | | | This is C++14 with conforming GNU extensions. llvm-svn: 320250
* Replace Sema-level implementation of -fassume-sane-operator-new with aRichard Smith2016-04-071-18/+17
| | | | | | | | | | | | | | CodeGen-level implementation. Instead of adding an attribute to clang's FunctionDecl, add the IR attribute directly. This means a module built with this flag is now compatible with code built without it and vice versa. This change also results in the 'noalias' attribute no longer being added to calls to operator new in the IR; it's now only added to the declaration. It also fixes a bug where we failed to add the attribute to the 'nothrow' versions (because we didn't implicitly declare them, there was no good time to inject a fake attribute). llvm-svn: 265728
* This test was still failing for me after r244925, fix it harder.Richard Smith2015-08-141-6/+3
| | | | llvm-svn: 244991
* Try to fix new.cpp after r244920 to make it passReid Kleckner2015-08-131-4/+4
| | | | llvm-svn: 244925
* Detect uses of mismatching forms of 'new' and 'delete'Ismail Pazarbasi2015-05-181-2/+2
| | | | | | | | | | | | | | | | | Emit warning when operand to `delete` is allocated with `new[]` or operand to `delete[]` is allocated with `new`. rev 2 update: `getNewExprFromInitListOrExpr` should return `dyn_cast_or_null` instead of `dyn_cast`, since `E` might be null. Reviewers: rtrieu, jordan_rose, rsmith Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4661 llvm-svn: 237608
* Revert "Detect uses of mismatching forms of 'new' and 'delete'"Diego Novillo2015-05-141-2/+2
| | | | | | | | | This reverts commit 742dc9b6c9686ab52860b7da39c3a126d8a97fbc. This is generating multiple segfaults in our internal builds. Test case coming up shortly. llvm-svn: 237391
* Detect uses of mismatching forms of 'new' and 'delete'Ismail Pazarbasi2015-05-141-2/+2
| | | | | | | | | | | | | Emit warning when operand to `delete` is allocated with `new[]` or operand to `delete[]` is allocated with `new`. Reviewers: rtrieu, jordan_rose, rsmith Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4661 llvm-svn: 237368
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-6/+6
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-6/+6
| | | | llvm-svn: 230783
* Update test to make it robust to migration to typeless pointersDavid Blaikie2015-02-151-3/+3
| | | | llvm-svn: 229269
* DR1748: the reserved placement allocation functions have undefined behavior ifRichard Smith2015-02-141-9/+40
| | | | | | | they're given a null pointer as an argument, so we do not need to emit null checks on their results. llvm-svn: 229213
* Bugfix: don't assert if someone manages to declare an operator new/delete ↵Richard Smith2014-06-051-1/+3
| | | | | | template before the builtin operator new/delete. llvm-svn: 210230
* Add __builtin_operator_new and __builtin_operator_delete, which act like callsRichard Smith2014-06-031-0/+9
| | | | | | | to the normal non-placement ::operator new and ::operator delete, but allow optimizations like new-expressions and delete-expressions do. llvm-svn: 210137
* Fix broken CHECK linesNico Rieck2014-02-161-2/+2
| | | | llvm-svn: 201477
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-11/+11
| | | | | | tests fail. llvm-svn: 188447
* Tighten up the set of operator new/operator delete calls we're permitted toRichard Smith2013-07-211-5/+83
| | | | | | | | | optimize, to follow the permissions granted in N3664. Under those rules, only calls generated by new-expressions and delete-expressions are permitted to be optimized, and direct calls to ::operator new and ::operator delete must be treated as normal calls. llvm-svn: 186799
* Fix a CodeGen bug where we would skip zero-initialization forEli Friedman2012-08-251-0/+10
| | | | | | array new with a non-trivial constructor. Pointed out in PR13380. llvm-svn: 162643
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-0/+11
| | | | llvm-svn: 150738
* Make array new on a pointer to data member type work correctly. PR11523.Eli Friedman2011-12-091-0/+8
| | | | llvm-svn: 146291
* Convert the standard default-construction loops to use phis andJohn McCall2011-07-131-7/+16
| | | | | | partial destruction. llvm-svn: 135033
* When instantiating a C++ "new" expression, don't fake source locationsDouglas Gregor2011-06-271-0/+13
| | | | | | | | for the '(' and ')' around the initializer unless we actually have an initializer. Fixes PR10197, an issue where we were value-initializing rather than default-initializing. llvm-svn: 133913
* Don't actually emit calls to the reserved global placement new and deleteJohn McCall2011-05-161-3/+49
| | | | | | | | | operators; their semantics are guaranteed by the language. If someone wants to argue that freestanding compiles shouldn't recognize this, I might be convinceable. llvm-svn: 131395
* Fix a few more ConvertTypes that should be ConvertTypeForMems, fixingDouglas Gregor2010-09-021-0/+4
| | | | | | two regressions in Boost.Config. llvm-svn: 112908
* Abstract IR generation of array cookies into the C++ ABI class andJohn McCall2010-09-021-0/+1
| | | | | | | | | | | | | | implement ARM array cookies. Also fix a few unfortunate bugs: - throwing dtors in deletes prevented the allocation from being deleted - adding the cookie to the new[] size was not being considered for overflow (and, more seriously, was screwing up the earlier checks) - deleting an array via a pointer to array of class type was not causing any destructors to be run and was passing the unadjusted pointer to the deallocator - lots of address-space problems, in case anyone wants to support free store in a variant address space :) llvm-svn: 112814
* Fix miscompilation. The cookie was not used when new'ing arrays with ↵Argyrios Kyrtzidis2010-08-261-1/+4
| | | | | | multiple dimensions. llvm-svn: 112188
* Fix miscompilation. The custom new[]/delete[] methods were not getting ↵Argyrios Kyrtzidis2010-08-251-0/+11
| | | | | | called for arrays with more than 1 dimension. llvm-svn: 112107
* Make sure to add MallocAttr to explicitly-declared operator new/new[]Douglas Gregor2010-08-181-0/+4
| | | | | | when -fassume-sane-operator-new. Patch by Tom Jablin! llvm-svn: 111363
* Implement zero-initialization for array new when there is anDouglas Gregor2010-07-211-4/+38
| | | | | | | | | initializer of (). Make sure to use a simple memset() when we can, or fall back to generating a loop when a simple memset will not suffice. Fixes <rdar://problem/8212208>, a regression due to my work in r107857. llvm-svn: 108977
* in 'new int[4]', constant fold the 4*4=16 instead of Chris Lattner2010-07-201-0/+1
| | | | | | doing an overflow check. llvm-svn: 108943
* temporarily disable this to fix the build bot.Chris Lattner2010-07-201-1/+0
| | | | llvm-svn: 108936
* Don't build an aggregate constructor loop when the constructor is trivial.Anders Carlsson2010-05-031-0/+10
| | | | llvm-svn: 102912
* Don't copy or initialize empty classes. Fixes PR7012.Anders Carlsson2010-05-031-1/+1
| | | | llvm-svn: 102891
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-041-1/+1
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100305
* Revert r100193 since it causes failures in objc in clangMon P Wang2010-04-021-1/+1
| | | | llvm-svn: 100200
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-021-1/+1
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100193
* Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.Bob Wilson2010-03-301-1/+1
| | | | llvm-svn: 99949
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-1/+1
| | | | | | memmove, and memset llvm-svn: 99930
* implement PR5654: add -fassume-sane-operator-new, which is enabled by ↵Nuno Lopes2009-12-161-1/+1
| | | | | | | | default, and adds the malloc attribute to the global function new() and to the overloaded new operators. feel free to chage the name to this lengthy argument llvm-svn: 91543
* Handle ImplicitValueInitExpr in AggExprEmitter.Anders Carlsson2009-12-161-0/+6
| | | | llvm-svn: 91519
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Fix the test case failed in buildbot.Fariborz Jahanian2009-11-241-1/+1
| | | | llvm-svn: 89791
* Refactor collection of call arguments in common code.Fariborz Jahanian2009-11-241-0/+11
| | | | | | | Add support for variadic collection functions. More to do here. llvm-svn: 89781
* Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.Anders Carlsson2009-11-221-0/+7
| | | | llvm-svn: 89613
* Fix test portability.Daniel Dunbar2009-11-121-1/+2
| | | | llvm-svn: 86911
* Emit new[] cookie when needed.Anders Carlsson2009-09-231-0/+8
| | | | llvm-svn: 82642
* Basic support for new[].Anders Carlsson2009-09-231-3/+12
| | | | llvm-svn: 82628
* Fix a thinko.Anders Carlsson2009-06-011-0/+4
| | | | llvm-svn: 72679
OpenPOWER on IntegriCloud