From 09959949896f2f0ff84b557176a8c21048d13cab Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 19 Oct 2012 06:20:53 +0000 Subject: [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 --- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib') 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); } -- cgit v1.2.3