<div class="gmail_quote">On Wed, Mar 14, 2012 at 4:47 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I was going to suggest to add a function attribute no_thread_safety_analysis (as we did for no_address_safety_analysis).</div></blockquote><div><br></div><div>Makes sense.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>clang already knows this attribute (it was added for thread-safety annotations), but does not propagate it to LLVM.</div><div class="im"><div></div></div></blockquote><div> ...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><div>Let me first add the no_thread_safety_analysis attribute to LLVM and then move the blacklist thing to clang. <br></div></div></blockquote><div><br></div><div>Awesome, thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><div></div></div>
<div>Would you suggest where in clang is the best place? </div></blockquote></div><br><div>Hmm, this is a touch tricky.</div><div><br></div><div>How big are these files likely to be? <10 entries? <100 entries? <1000 entries?</div>
<div><br></div><div>If <100 entries, I would actually prefer to use the following layering:</div><div><br></div><div>Clang Driver: parses flag, loads file, extracts each entry from the file into a flag (either separate flags, or more likely, a really long comma-separated list of values to a single flag) passed to the CC1 layer.</div>
<div><br></div><div>Clang Frontend: Parses flag into N entries (but doesn't interpret them) and stashes those into a side table of the code gen options.</div><div><br></div><div>Clang CodeGen: Does whatever is needed to efficiently test each function against the blacklist.</div>
<div><br></div><div><br></div><div>If we have over 100 entries, this starts to get *really* ugly. In that case, we probably need the Driver to parse the option, convert the filename to a rooted canonical path, and hand that to the Frontend. Then the Frontend will have to open and read the file and setup the list of entries for CodeGen. I'm hoping we can have Frontend deal only in terms of flags though....</div>