[llvm-commits] Please review: adding Function attribute "ThreadSafety"

Chris Lattner clattner at apple.com
Thu Mar 15 02:07:32 PDT 2012


On Mar 14, 2012, at 6:08 PM, Kostya Serebryany wrote:

> Hello, 
> 
> I would like to add one more function attribute: "ThreadSafety".
> Functions with this attribute will be instrumented by run-time thread-safety analysis tools (e.g. with ThreadSanitizer).
> This is similar to "AddressSafety" attribute used by AddressSanitizer (and SAFECode?).
> 
> Clang already has the attribute "__attribute__((no_thread_safety_analysis))" which is used to disable static thread-safety analysis. 
> http://clang.llvm.org/docs/LanguageExtensions.html#threadsafety
> In a separate change we will teach clang to unset ThreadSafety when no_thread_safety_analysis is present. 
> (exactly as we do for no_address_safety_analysis and AddressSafety)

Hi Kostya,

I'm skeptical of adding LLVM IR function attributes for each instrumentation pass.  Have you investigated using module flags metadata to track this information?  It is designed to be extensible for these sorts of uses.

http://llvm.org/docs/LangRef.html#module_flags

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120315/b87517a0/attachment.html>


More information about the llvm-commits mailing list