diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-09-10 01:06:11 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-09-10 01:06:11 +0000 |
commit | 3ac3aa50f6c98a42e50b4265e8fb92cbbe919140 (patch) | |
tree | aa039008e74470f77dbb49568f83a6adaddce134 /llvm/lib/Transforms | |
parent | d98cf00c95438fd6eb2124f352ade7a59e8c071e (diff) | |
download | bcm5719-llvm-3ac3aa50f6c98a42e50b4265e8fb92cbbe919140.tar.gz bcm5719-llvm-3ac3aa50f6c98a42e50b4265e8fb92cbbe919140.zip |
[asan] Add flag to allow lifetime analysis of problematic allocas
Summary:
Could be useful for comparison when we suspect that alloca was skipped
because of this.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D24437
llvm-svn: 281126
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 0e5e871df9a..1850b0c56ec 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -183,6 +183,10 @@ static cl::opt<bool> ClExperimentalPoisoning( "asan-experimental-poisoning", cl::desc("Enable experimental red zones and scope poisoning"), cl::Hidden, cl::init(true)); +static cl::opt<bool> ClSkipAmbiguousLifetimeAllocas( + "asan-skip-ambiguous-lifetime-allocas", + cl::desc("Disabled lifetime check for allocas with ambiguous lifetime"), + cl::Hidden, cl::init(true)); // This flag may need to be replaced with -f[no]asan-globals. static cl::opt<bool> ClGlobals("asan-globals", cl::desc("Handle global objects"), cl::Hidden, @@ -890,6 +894,8 @@ public: // This is workaround for PR28267. void removeAllocasWithAmbiguousLifetime( SmallVectorImpl<FunctionStackPoisoner::AllocaPoisonCall> &PoisonCallVec) { + if (!ClSkipAmbiguousLifetimeAllocas) + return; DenseMap<const AllocaInst *, AllocaLifetimeChecker> Checkers; for (const auto &APC : PoisonCallVec) Checkers[APC.AI].AddMarker(APC.InsBefore->getParent(), !APC.DoPoison); |