[PATCH] D21254: [asan] Do not instrument pointers with address space attributes

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 02:02:00 PDT 2016

kubabrecka accepted this revision.
kubabrecka added a comment.
This revision is now accepted and ready to land.

LGTM with two nits.

Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:953
@@ +952,3 @@
+  if (PtrOperand) {
+    Type *PtrTy = cast<PointerType>(PtrOperand->getType()->getScalarType());
+    if (PtrTy->getPointerAddressSpace() != 0)
Are we sure the cast is *always* valid?  Maybe a dyn_cast + if would be better, but it’s up to you.

Comment at: test/Instrumentation/ThreadSanitizer/tsan_address_space_attr.ll:32
@@ +31,2 @@
+; CHECK-NOT: addrspacecast
Can we check for the presence of the instrumentation call instead?  The presence or non-presence of “addrspacecast” is a secondary thing.


More information about the llvm-commits mailing list