summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/sanitize-dtor-derived-class.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Implementation and testing for poisoning vtableNaomi Musgrave2015-09-161-3/+9
| | | | | | | | | | | | | | | | | | | | | | ptr in dtor. Summary: After destruction, invocation of virtual functions prevented by poisoning vtable pointer. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12712 Fixed testing callback emission order to account for vptr. Poison vtable in either complete or base dtor, depending on if virtual bases exist. If virtual bases exist, poison in complete dtor. Otherwise, poison in base. Remove commented-out block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247762 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix previous commit: poison only class members, simpler testsNaomi Musgrave2015-08-131-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Poisoning applied to only class members, and before dtors for base class invoked Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes. Members are poisoned only once, by the last dtor for a class. Skip poisoning if class has no fields. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Removed patch file containing extraneous changes. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 Simplified test cases for use-after-dtor Summary: Simplified test cases to focus on one feature at time. Tests updated to align with new emission order for sanitizing callback. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244933 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Implement poisoning of only class members in dtor, as opposed to ↵Naomi Musgrave2015-08-121-62/+0
| | | | | | | | | also poisoning fields inherited from base classes." This reverts commit 8dbbf3578a9a5d063232b59e558e5fe46e2cd42c. Rolled back due to buildbot failures on 'ninja check-clang'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244820 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement poisoning of only class members in dtor, as opposed to also ↵Naomi Musgrave2015-08-121-0/+62
poisoning fields inherited from base classes. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Changed emission order for dtor callback, so only the last dtor for a class emits the sanitizing callback, while ensuring that class members are poisoned before base class destructors are invoked. Skip poisoning of members, if class has no fields. Removed patch file containing extraneous changes. Summary: Poisoning applied to only class members, and before dtors for base class invoked Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244819 91177308-0d34-0410-b5e6-96231b3b80d8