From: Kuba Brecka Date: Fri, 17 Jul 2015 19:20:21 +0000 (+0000) Subject: [asan] Add a comment explaining why non-instrumented allocas are moved. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b8850e4b6292f3589b2c59133683e64b2f3b39b5;p=oota-llvm.git [asan] Add a comment explaining why non-instrumented allocas are moved. Addition to r242510. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242561 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index a67a9a217a4..a98439b6b39 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1738,6 +1738,9 @@ void FunctionStackPoisoner::poisonStack() { IRBuilder<> IRB(InsBefore); IRB.SetCurrentDebugLocation(EntryDebugLocation); + // Make sure non-instrumented allocas stay in the first basic block. + // Otherwise, debug info is broken, because only first-basic-block allocas are + // treated as regular stack slots. for (auto *AI : NonInstrumentedStaticAllocaVec) AI->moveBefore(InsBefore); SmallVector SVD;