[PATCH] D12704: [ASan] Don't instrument promotable dynamic allocas.
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 13:48:31 PDT 2015
samsonov created this revision.
samsonov added a reviewer: ygribov.
samsonov added a subscriber: llvm-commits.
We already have a test that checks that promotable dynamic allocas are
ignored, as well as static promotable allocas. Make sure this test will
still pass if/when we enable dynamic alloca instrumentation by default.
http://reviews.llvm.org/D12704
Files:
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll
Index: test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll
===================================================================
--- test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll
+++ test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll
@@ -3,6 +3,7 @@
; breaks debug info.
; RUN: opt < %s -asan -asan-module -S | FileCheck %s
+; RUN: opt < %s -asan -asan-module -asan-instrument-allocas=1 -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -839,8 +839,7 @@
getAllocaSizeInBytes(&AI) > 0 &&
// We are only interested in allocas not promotable to registers.
// Promotable allocas are common under -O0.
- (!ClSkipPromotableAllocas || !isAllocaPromotable(&AI) ||
- isDynamicAlloca(AI)));
+ (!ClSkipPromotableAllocas || !isAllocaPromotable(&AI)));
ProcessedAllocas[&AI] = IsInteresting;
return IsInteresting;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12704.34252.patch
Type: text/x-patch
Size: 1249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150908/2d97edb8/attachment.bin>
More information about the llvm-commits
mailing list