<div dir="ltr">Hi, <div><br></div><div>Clang has two attributes to disable bug detection tools in a given function: </div><div><br></div><div>__attribute__((no_thread_safety_analysis)) disables clang's *static* thread-safety analysis. (<a href="http://clang.llvm.org/docs/LanguageExtensions.html#thread-safety-annotation-checking">http://clang.llvm.org/docs/LanguageExtensions.html#thread-safety-annotation-checking</a>)</div>
<div style><br></div><div style>__attribute__((no_address_safety_analysis)) disables AddressSanitizer (*dynamic* analysis)<br></div><div><div><a href="http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-dynamic-analysis">http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-dynamic-analysis</a><br>
</div><div><br></div><div>Now we need two more attributes to disable <br></div><div style>ThreadSanitizer (<a href="http://clang.llvm.org/docs/ThreadSanitizer.html">http://clang.llvm.org/docs/ThreadSanitizer.html</a>)</div>
<div style>and MemorySanitizer (<a href="http://clang.llvm.org/docs/MemorySanitizer.html">http://clang.llvm.org/docs/MemorySanitizer.html</a>)</div><div><br></div><div style>For MemorySanitizer I propose __attribute__((no_uninitialized_checks))</div>
<div style>Objections? Better naming suggestion?</div><div style>Maybe __attribute__((no_memory_sanitizer))?</div><div style>(We deliberately named no-asan attribute "no_address_safety_analysis" w/o mentioning asan</div>
<div style>in the name to make this attribute usable for other tools, e.g. SAFECode. So, </div><div style>we may not want to tie the no-msan attribute to msan)</div><div style><br></div><div style>For ThreadSanitizer the question is a bit trickier. </div>
<div style>We can reuse __attribute__((no_thread_safety_analysis)) which makes sense</div><div style>because it already means a similar thing.</div><div style><br></div><div style>OTOH, most of the current uses of no_thread_safety_analysis I know about </div>
<div style>are there because of the limitations of clang's static analysis. </div><div style>And we don't need to disable ThreadSanitizer for the majority of those cases,</div><div style>which means we may better use another attribute to disable ThreadSanitizer checking. </div>
<div style>How to name it? </div><div style>__attribute__((no_thread_sanitizer))?<br></div><div style>__attribute__((no_dynamic_thread_safety_analysis))?<br></div><div style>__attribute__((thread_sanitizer_ignore_plain_memory_accesses))?<br>
</div><div style><br></div><div style>The patch discussion: <a href="http://llvm-reviews.chandlerc.com/D390" target="_blank" style="font-size:13px;font-family:arial,sans-serif">http://llvm-reviews.chandlerc.com/D390</a></div>
</div><div style><br></div><div style>Thanks, </div><div style><br></div><div style>--kcc </div></div>