summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-07-17 19:20:21 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-07-17 19:20:21 +0000
commit7f5475318044507d6a43550422ddc431109ae079 (patch)
tree55fdf84fdb78a0c6b3725f29d40dee3b6b5fd824 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
parent2e3b97d4fbdfa33367ffae04db000daeb43fdcdf (diff)
downloadbcm5719-llvm-7f5475318044507d6a43550422ddc431109ae079.tar.gz
bcm5719-llvm-7f5475318044507d6a43550422ddc431109ae079.zip
[asan] Add a comment explaining why non-instrumented allocas are moved.
Addition to r242510. llvm-svn: 242561
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index a67a9a217a4..a98439b6b39 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/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<ASanStackVariableDescription, 16> SVD;
OpenPOWER on IntegriCloud