[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
This commit is contained in:
Kuba Brecka 2015-07-17 19:20:21 +00:00
parent beda80e3bb
commit b8850e4b62

View File

@ -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;