diff options
author | Kostya Serebryany <kcc@google.com> | 2012-10-19 06:20:53 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-10-19 06:20:53 +0000 |
commit | bd0052a0f26f04b8fcf59e8f645e5e33751e1f6e (patch) | |
tree | abadccd16f7d0ee24be4554fad2307dd2996fcd8 /lib/Transforms | |
parent | 725f1d12801109a3b1d081a6e1c9e44426b2cf34 (diff) |
[asan] make sure asan erases old unused allocas after it created a new one. This became important after the recent move from ModulePass to FunctionPass because no cleanup is happening after asan pass any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 75f42f30fa..d99bb87fd4 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1148,6 +1148,10 @@ bool AddressSanitizer::poisonStackInFunction(Function &F) { } } + // We are done. Remove the old unused alloca instructions. + for (size_t i = 0, n = AllocaVec.size(); i < n; i++) + AllocaVec[i]->eraseFromParent(); + if (ClDebugStack) { DEBUG(dbgs() << F); } |