Hello, <div><br></div><div>I'd like to resurrect an old discussion: how to selectively disable ThreadSanitizer (or AddressSanitizer, etc) instrumentation </div><div>for particular functions. </div><div>For AddressSanitizer we currently use a function attribute "AddressSafety" (if it is not set, instrumentation does not happen), </div>
<div>but Chris doesn't like this idea (attributes are a scarce resource) and he suggested to use module-level metadata instead of an attribute. </div><div><br></div><div>The attached clang patch adds such metadata node for all functions when -fthread-sanitizer is given. </div>
<div>If that is what we want, I'll gradually change AddressSanitizer to use similar approach and will kill the "AddressSafety" attribute.</div><div><br></div><div>BTW, the code looks like this:</div><div> llvm::Value *Fn[] = { F }; ...</div>
<div><div> llvm::MDNode::get(VMContext, Fn);</div></div><div>Do we want this code to look like </div><div> llvm::MDNode::get(VMContext, F); </div><div>(i.e. to add more llvm::MDNode::get() methods)?</div><div><br></div>
<div>Thanks, </div><div><br></div><div>--kcc </div><div><br></div>