summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/destructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-3/+3
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344526 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-3/+3
| | | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344150 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Mark aliases of ctors and dtors as unnamed_addr.Peter Collingbourne2018-06-181-6/+6
| | | | | | | | | This is not only semantically correct but ensures that they will not be marked as address-significant once D48155 lands. Differential Revision: https://reviews.llvm.org/D48206 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334982 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for lifetime intrinsic signature changeMatt Arsenault2017-04-101-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299877 91177308-0d34-0410-b5e6-96231b3b80d8
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Much to my surprise, '-disable-llvm-optzns' which I thought was the magical flag I wanted to get at the raw LLVM IR coming out of Clang deosn't do that. It still runs some passes over the IR. I don't want that, I really want the *raw* IR coming out of Clang and I strongly suspect everyone else using it is in the same camp. There is actually a flag that does what I want that I didn't know about called '-disable-llvm-passes'. I suspect many others don't know about it either. It both does what I want and is much simpler. This removes the confusing version and makes that spelling of the flag an alias for '-disable-llvm-passes'. I've also moved everything in Clang to use the 'passes' spelling as it seems both more accurate (*all* LLVM passes are disabled, not just optimizations) and much easier to remember and spell correctly. This is part of simplifying how Clang drives LLVM to make it cleaner to wire up to the new pass manager. Differential Revision: https://reviews.llvm.org/D28047 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290392 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11 test cleanup: nonthrowing destructorsPaul Robinson2016-12-201-45/+83
| | | | | | | | | | | If a dtor has no interesting members, then it ends up being nothrow, which affects the generated IR. Modify some tests to tolerate this difference between C++03 and C++11. Differential Revision: http://reviews.llvm.org/D27936 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290207 91177308-0d34-0410-b5e6-96231b3b80d8
* Undo accidental comitPaul Robinson2016-12-191-83/+45
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290121 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a few OpenMP tests "C++11 clean."Paul Robinson2016-12-191-45/+83
| | | | | | | | Reviewed by abataev (in D27794) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290120 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Emit lifetime.end intrinsic after objects are destructed inAkira Hatanaka2016-04-011-0/+64
| | | | | | | | | | | | | | | | | landing pads. Previously, lifetime.end intrinsics were inserted only on normal control flows. This prevented StackColoring from merging stack slots for objects that were destroyed on the exception handling control flow since it couldn't tell their lifetime ranges were disjoint. This patch fixes code-gen to emit the intrinsic on both control flows. rdar://problem/22181976 Differential Revision: http://reviews.llvm.org/D18196 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265197 91177308-0d34-0410-b5e6-96231b3b80d8
* [opaque pointer type] update test cases for explicit pointee types on global ↵David Blaikie2015-09-111-1/+1
| | | | | | aliases git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247380 91177308-0d34-0410-b5e6-96231b3b80d8
* Update clang to take into account the changes to personality fnsDavid Majnemer2015-06-171-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239941 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r234581, it might have caused a few miscompiles in Chromium."David Majnemer2015-04-221-1/+4
| | | | | | | | This reverts commit r234700. It turns out that the lifetime markers were not the cause of Chromium failing but a bug which was uncovered by optimizations exposed by the markers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235553 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r234581, it might have caused a few miscompiles in Chromium.Nico Weber2015-04-111-4/+1
| | | | | | | | If the revert helps, I'll get a repro this Monday. Else I'll put the change back in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234700 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove threshold for inserting lifetime markers for named temporariesArnaud A. de Grandmaison2015-04-101-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. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234581 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230795 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230783 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226751 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222995 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222993 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219307 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219303 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217874 91177308-0d34-0410-b5e6-96231b3b80d8
* Test cleanup: move CHECK close to code.Rafael Espindola2014-09-011-132/+131
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216892 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup the test a bit. It was too dependent on the output order.Rafael Espindola2014-08-291-180/+176
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216802 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm API change.Rafael Espindola2014-06-031-2/+2
| | | | | | Aliases in llvm now hold an arbitrary expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210063 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209008 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205398 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Fix cast when structor replacement is an aliasReid Kleckner2014-02-031-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200711 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196784 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194618 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194452 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194358 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194357 91177308-0d34-0410-b5e6-96231b3b80d8
* Use rauw for all discardable aliases, not just linkonce_odr.Rafael Espindola2013-11-081-18/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194296 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194288 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194095 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand the test a bit.Rafael Espindola2013-11-051-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194050 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a testcase from the recent bootstrap failure.Rafael Espindola2013-11-051-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194049 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194047 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194046 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194000 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't hardcode the alias order in this test.Rafael Espindola2013-10-111-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192464 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192353 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192300 91177308-0d34-0410-b5e6-96231b3b80d8
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-26/+26
| | | | | | tests fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
* Test updates missed from r186799.Richard Smith2013-07-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186800 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-4/+6
| | | | | | attributes on the call/invoke instructions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175878 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/CodeGenCXX: Fix two tests, destructors.cpp and ↵NAKAMURA Takumi2012-05-011-1/+1
| | | | | | microsoft-abi-array-cookies.cpp, for -Asserts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155913 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155893 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140049 91177308-0d34-0410-b5e6-96231b3b80d8