summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-12-14 21:56:59 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-12-14 21:56:59 +0000
commit1e69017a6d5b3eb136de847eeb52058f3d6df088 (patch)
treeaecd7497f15ecb557b6e9a724e8f3ead393bb3f7 /llvm/lib/Transforms/Instrumentation
parenta361aa3cc992ac56463768e603aefa144a860bd3 (diff)
downloadbcm5719-llvm-1e69017a6d5b3eb136de847eeb52058f3d6df088.tar.gz
bcm5719-llvm-1e69017a6d5b3eb136de847eeb52058f3d6df088.zip
[asan] Hook ClInstrumentWrites and ClInstrumentReads to masked operation instrumentation.
Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27548 llvm-svn: 289717
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 42d3cb68446..633df4f3b3a 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1046,10 +1046,14 @@ Value *AddressSanitizer::isInterestingMemoryAccess(Instruction *I,
F->getName().startswith("llvm.masked.store."))) {
unsigned OpOffset = 0;
if (F->getName().startswith("llvm.masked.store.")) {
+ if (!ClInstrumentWrites)
+ return nullptr;
// Masked store has an initial operand for the value.
OpOffset = 1;
*IsWrite = true;
} else {
+ if (!ClInstrumentReads)
+ return nullptr;
*IsWrite = false;
}
// Only instrument if the mask is constant for now.
OpenPOWER on IntegriCloud