From b8850e4b6292f3589b2c59133683e64b2f3b39b5 Mon Sep 17 00:00:00 2001 From: Kuba Brecka Date: Fri, 17 Jul 2015 19:20:21 +0000 Subject: [PATCH] [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 --- lib/Transforms/Instrumentation/AddressSanitizer.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.34.1