[PATCH] D14724: [sanitizer] [dfsan] Unify aarch64 mapping
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 16 19:50:00 PST 2015
pcc added a comment.
Test case please.
================
Comment at: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:78
@@ -84,1 +77,3 @@
+// the runtime will set the external mask based on the VMA range.
+static const char *const kDFSanExternShadoPtrMask = "__dfsan_shadow_ptr_mask";
----------------
Shado -> Shadow
================
Comment at: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:135
@@ +134,3 @@
+// address.
+static cl::opt<bool> ClRuntimeShadowMaskValue(
+ "dfsan-runtime-shadow-mask-value",
----------------
There is no need to add a flag for this; you can derive it directly from the target.
================
Comment at: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:447
@@ -441,2 +446,3 @@
IntptrTy = DL.getIntPtrType(*Ctx);
+ IntTy = IntegerType::get(*Ctx, IntptrTy->getBitWidth());
ZeroShadow = ConstantInt::getSigned(ShadowTy, 0);
----------------
This is the same type as `IntptrTy`.
================
Comment at: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:947
@@ +946,3 @@
+ Value *ExternalShadowMask =
+ Mod->getOrInsertGlobal(kDFSanExternShadoPtrMask, IntTy);
+ ShadowPtrMaskValue = IRB.CreateLoad(IntTy, ExternalShadowMask);
----------------
Please create this global in `DataFlowSanitizer::runOnModule` with the others.
http://reviews.llvm.org/D14724
More information about the llvm-commits
mailing list