Hello,

I'd like to resurrect an old discussion: how to selectively disable
ThreadSanitizer (or AddressSanitizer, etc) instrumentation
for particular functions.
For AddressSanitizer we currently use a function attribute "AddressSafety"
(if it is not set, instrumentation does not happen),
but Chris doesn't like this idea (attributes are a scarce resource) and he
suggested to use module-level metadata instead of an attribute.

The attached clang patch adds such metadata node for all functions when
-fthread-sanitizer is given.
If that is what we want, I'll gradually change AddressSanitizer to use
similar approach and will kill the "AddressSafety" attribute.

BTW, the code looks like this:
  llvm::Value *Fn[] = { F }; ...
  llvm::MDNode::get(VMContext, Fn);
Do we want this code to look like
  llvm::MDNode::get(VMContext, F);
(i.e. to add more llvm::MDNode::get() methods)?

Thanks,

--kcc

Attachment: tsan_metadata.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to