summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/destructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-8/+8
| | | | llvm-svn: 230783
* Emit DeferredDeclsToEmit in a DFS order.Rafael Espindola2015-01-221-9/+8
| | | | | | | | | | | | | | Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that. The advantages of the change are that * The output order is a bit closer to the source order. The change to test/CodeGenCXX/pod-member-memcpys.cpp is a good example. * If we decide to deffer more, it will not cause as large changes in the estcases as it would without this patch. llvm-svn: 226751
* Revert "Remove threshold for lifetime marker insertion of named temporaries"Arnaud A. de Grandmaison2014-12-011-4/+1
| | | | | | Revert r222993 while I investigate some MemorySanitizer failures. llvm-svn: 222995
* Remove threshold for lifetime marker insertion of named temporariesArnaud A. de Grandmaison2014-12-011-1/+4
| | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. llvm-svn: 222993
* Revert "Remove threshold on object size for inserting lifetime begin / end"Arnaud A. de Grandmaison2014-10-081-7/+2
| | | | | | Revert this patch while I investigate some sanitizer failures off-line. llvm-svn: 219307
* Remove threshold on object size for inserting lifetime begin / endArnaud A. de Grandmaison2014-10-081-2/+7
| | | | | | | | | Boostrapping LLVM+Clang+LLDB without threshold on object size for lifetime markers insertion has shown there was no significant change in compile time, so let the stack slot colorizer do its optimization for all slots. llvm-svn: 219303
* Add support for putting constructors and destructos in explicit comdats.Rafael Espindola2014-09-161-6/+7
| | | | | | | | | | | | | | | | | | There are situations when clang knows that the C1 and C2 constructors or the D1 and D2 destructors are identical. We already optimize some of these cases, but cannot optimize it when the GlobalValue is weak_odr. The problem with weak_odr is that an old TU seeing the same code will have a C1 and a C2 comdat with the corresponding symbols. We cannot suddenly start putting the C2 symbol in the C1 comdat as we cannot guarantee that the linker will not pick a .o with only C1 in it. The solution implemented by GCC is to expand the ABI to have a comdat whose name uses a C5/D5 suffix and always has both symbols. That is what this patch implements. llvm-svn: 217874
* Test cleanup: move CHECK close to code.Rafael Espindola2014-09-011-132/+131
| | | | llvm-svn: 216892
* Cleanup the test a bit. It was too dependent on the output order.Rafael Espindola2014-08-291-180/+176
| | | | llvm-svn: 216802
* Update for llvm API change.Rafael Espindola2014-06-031-2/+2
| | | | | | Aliases in llvm now hold an arbitrary expression. llvm-svn: 210063
* Update for llvm api change.Rafael Espindola2014-05-161-2/+2
| | | | | | | | | | Now that llvm cannot represent alias cycles, we have to diagnose erros just before trying to close the cycle. This degrades the errors a bit. The real solution is what it was before: if we want to provide good errors for these cases, we have to be able to find a clang level decl given a mangled name and produce the error from Sema. llvm-svn: 209008
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-3/+3
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* [ms-cxxabi] Fix cast when structor replacement is an aliasReid Kleckner2014-02-031-0/+7
| | | | llvm-svn: 200711
* Output destructors and constructors in a more natural order.Rafael Espindola2013-12-091-12/+12
| | | | | | | | | | | | | | | | With this patch we output the in the order C2 C1 D2 D1 D0 Which means that a destructor or constructor that call another is output after the callee. This is a bit easier to read IHMO and a tiny bit more efficient as we don't put a decl in DeferredDeclsToEmit. llvm-svn: 196784
* Don't use alias from derived dtor to base dtor at -O0.Rafael Espindola2013-11-131-1/+1
| | | | | | | | | | This patch disables aliasing (and rauw) of derived dtors to base dtors at -O0. This optimization can have a negative impact on the debug quality. This was a latent bug for some time with local classes, but got noticed when it was generalized and broke gdb's destrprint.exp. llvm-svn: 194618
* Keep the old function order in CodeGenModule::applyReplacements.Rafael Espindola2013-11-121-8/+8
| | | | | | | | | | | | | | The original decls are created when used. The replacements are created at the end of the TU in reverse order. This makes the original order far better for testing. This is particularly important since the replacement logic could be used even when -mconstructor-aliases is not used, but that would make many tests hard to read. This is a fixed version of r194357 which handles replacing a destructor with another which is an alias to a third one. llvm-svn: 194452
* Revert "Keep the old function order in CodeGenModule::applyReplacements."Rafael Espindola2013-11-111-8/+8
| | | | | | | | This reverts commit r194357. Debugging a cast failure during bootstrap. llvm-svn: 194358
* Keep the old function order in CodeGenModule::applyReplacements.Rafael Espindola2013-11-101-8/+8
| | | | | | | | | | | The original decls are created when used. The replacements are created at the end of the TU in reverse order. This makes the original order far better for testing. This is particularly important since the replacement logic could be used even when -mconstructor-aliases is not used, but that would make many tests hard to read. llvm-svn: 194357
* Use rauw for all discardable aliases, not just linkonce_odr.Rafael Espindola2013-11-081-18/+4
| | | | llvm-svn: 194296
* If a linkonce_odr dtor/ctor is identical to another one, just rauw.Rafael Espindola2013-11-081-1/+1
| | | | | | | Unlike an alias a rauw is always safe, so we don't need to avoid this optimization when the replacement is not know to be available in every TU. llvm-svn: 194288
* Produce direct calls instead of alias to linkonce_odr functions.Rafael Espindola2013-11-051-4/+6
| | | | | | | This is a small optimization on linux, but should help more on windows where msvc only outputs one destructor if there would be two identical ones. llvm-svn: 194095
* Expand the test a bit.Rafael Espindola2013-11-051-1/+4
| | | | llvm-svn: 194050
* Add a testcase from the recent bootstrap failure.Rafael Espindola2013-11-051-0/+13
| | | | llvm-svn: 194049
* Revert "Produce direct calls instead of alias to linkonce_odr functions."Rafael Espindola2013-11-051-3/+1
| | | | | | | This reverts commit r194046. Debugging a bootstrap issue. llvm-svn: 194047
* Produce direct calls instead of alias to linkonce_odr functions.Rafael Espindola2013-11-051-1/+3
| | | | | | | This is a small optimization on linux, but should help more on windows where msvc only outputs one destructor if there would be two identical ones. llvm-svn: 194046
* Use aliases for more constructors and destructors.Rafael Espindola2013-11-041-8/+6
| | | | | | | | | | | | | | | | With this patch we produce alias for cases like template<typename T> struct foobar { foobar() { } }; template struct foobar<void>; We just have to be careful to produce the same aliases in every TU because of comdats. llvm-svn: 194000
* Don't hardcode the alias order in this test.Rafael Espindola2013-10-111-9/+9
| | | | llvm-svn: 192464
* Revert "Use aliases for more constructors and destructors."Rafael Espindola2013-10-101-28/+3
| | | | | | | | | This reverts commit r192300. The change itself looks correct, but it found issues on how we handle aliases in llvm. llvm-svn: 192353
* Use aliases for more constructors and destructors.Rafael Espindola2013-10-091-3/+28
| | | | | | | | | | | | | | | | With this patch we produce alias for cases like template<typename T> struct foobar { foobar() { } }; template struct foobar<void>; It is safe to use aliases to weak symbols, as long and the alias itself is also weak. llvm-svn: 192300
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-26/+26
| | | | | | tests fail. llvm-svn: 188447
* Test updates missed from r186799.Richard Smith2013-07-211-1/+1
| | | | llvm-svn: 186800
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-4/+6
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* clang/test/CodeGenCXX: Fix two tests, destructors.cpp and ↵NAKAMURA Takumi2012-05-011-1/+1
| | | | | | microsoft-abi-array-cookies.cpp, for -Asserts. llvm-svn: 155913
* PR12710 - broken default argument handling for templates.David Blaikie2012-05-011-0/+16
| | | | | | | | | | | | | | | I broke this in r155838 by not actually instantiating non-dependent default arg expressions. The motivation for that change was to avoid producing duplicate conversion warnings for such default args (we produce them once when we parse the template - there's no need to produce them at each instantiation) but without actually instantiating the default arg, things break in weird ways. Technically, I think we could still get the right diagnostic experience without the bugs if we instantiated the non-dependent args (for non-dependent params only) immediately, rather than lazily. But I'm not sure if such a refactoring/ change would be desirable so here's the conservative fix for now. llvm-svn: 155893
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-4/+6
| | | | | | | | | | | | | This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-1/+0
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* Be sure to destroy the normal entry block of a cleanup that weJohn McCall2011-08-061-0/+25
| | | | | | | | | | | | | | | aren't actually going to make a normal cleanup for. Sometimes we optimistically create branches to such blocks for fixups, and then we resolve the fixup to somewhere within the cleanup's scope, and then the cleanup is actually not reachable for some reason. The process of resolving the fixup leaves us with switches whose default edge leads to the cleanup; we can replace that with unreachable, then (in many cases) turn the switch into an unconditional branch. Fixes PR10467. llvm-svn: 137011
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-111-2/+13
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-5/+5
| | | | llvm-svn: 134831
* A number of array-related IR-gen cleanups.John McCall2011-07-091-18/+7
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-2/+2
| | | | | | It's quite likely that this will explode, but I need to know how. :) llvm-svn: 132269
* Back out r132209; it's breaking nightly tests.Eli Friedman2011-05-271-2/+2
| | | | llvm-svn: 132219
* Implement a new, much improved version of the cleanup hack. We just needJohn McCall2011-05-271-2/+2
| | | | | | | | to be careful to emit landing pads that are always prepared to handle a cleanup path. This is correct mostly because of the fix to the LLVM inliner, r132200. llvm-svn: 132209
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Look through array types when deciding whether a field requires non-trivialJohn McCall2011-02-131-0/+20
| | | | | | destruction in the destructor-aliases logic. Fixes PR 9197. llvm-svn: 125447
* Move unnamed_addr after the function arguments on Sabre's request.Rafael Espindola2011-01-251-17/+17
| | | | llvm-svn: 124210
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-17/+17
| | | | llvm-svn: 123197
* Implement proper base/member destructor EH chaining.John McCall2010-07-211-1/+47
| | | | llvm-svn: 108989
* Convert the EH cleanups for base and member destructors in a constructor intoJohn McCall2010-07-211-5/+5
| | | | | | lazy cleanups. llvm-svn: 108978
OpenPOWER on IntegriCloud