[llvm] r242561 - [asan] Add a comment explaining why non-instrumented allocas are moved.

Kuba Brecka kuba.brecka at gmail.com
Fri Jul 17 12:20:21 PDT 2015


Author: kuba.brecka
Date: Fri Jul 17 14:20:21 2015
New Revision: 242561

URL: http://llvm.org/viewvc/llvm-project?rev=242561&view=rev
Log:
[asan] Add a comment explaining why non-instrumented allocas are moved.

Addition to r242510.


Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=242561&r1=242560&r2=242561&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Fri Jul 17 14:20:21 2015
@@ -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<ASanStackVariableDescription, 16> SVD;





More information about the llvm-commits mailing list