summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-10-19 06:20:53 +0000
committerKostya Serebryany <kcc@google.com>2012-10-19 06:20:53 +0000
commit09959949896f2f0ff84b557176a8c21048d13cab (patch)
tree757c460958fd14c17d83b9e69491f7b8c89fb335 /llvm/lib/Transforms
parent703c47f80784486bc22fd77371f4423b61c4fb44 (diff)
downloadbcm5719-llvm-09959949896f2f0ff84b557176a8c21048d13cab.tar.gz
bcm5719-llvm-09959949896f2f0ff84b557176a8c21048d13cab.zip
[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.
llvm-svn: 166267
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 75f42f30fab..d99bb87fd4c 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud