<div dir="ltr">On Tue, Jan 29, 2013 at 2:07 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugenis@google.com" target="_blank" class="cremed">eugenis@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Jan 29, 2013 at 2:02 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>> wrote:<br>

> On Tue, Jan 29, 2013 at 1:49 AM, Nick Lewycky <<a href="mailto:nlewycky@google.com" class="cremed">nlewycky@google.com</a>> wrote:<br>
>><br>
>> On 28 January 2013 06:22, Kostya Serebryany <<a href="mailto:kcc@google.com" class="cremed">kcc@google.com</a>> wrote:<br>
>>><br>
>>><br>
>>>   Maybe put this into lib/Support/Valgrind.cpp and/or<br>
>>> include/llvm/Support/Valgrind.h ?<br>
>>>   Or maybe rename these files into something Valgrind-neutral?<br>
>><br>
>><br>
>> I'd prefer renaming them to something valgrind-neutral, but I simply can<br>
>> not think of any name. If you can think of something, go for it.<br>
>><br>
>> There needs to be some meaning to this name. For instance Sanitizer.h<br>
>> would work, as it's just as acceptable for sanitizer macros as Valgrind.h is<br>
>> for valgrind macros.<br>
><br>
><br>
> For sanitizer functions, shouldn't the sanitizer ship a builtin header file<br>
> we include to get their declarations?<br>
<br>
</div>Yes, I think we discussed it briefly once. Should we install<br>
sanitizer/*_interface.h headers to lib/clang/$VERSION/include?<br></blockquote><div><br></div><div style>I think the idea had been to do that, yes.</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
> For the compatibility macros that wrap these in LLVM's code to remain<br>
> interoperable, I would vote for either Compiler.h, a new Sanitizer.h, or<br>
> MemoryAnnotations.h in order of vaguely decreasing preference.<br>
<br>
</div>Compiler.h does not really capture the spirit of Valgrind annotations.<br>
MemoryAnnotations.h, or maybe DynamicTools.h, or DynamicAnnotations.h?<br></blockquote><div><br></div><div style>On further consideration, I'd like to hoist more of this up into the interface header provided by the sanitizer. Essentially, there is no reason it can't bundle all of the logic about making the annotation a no-op when the particular sanitizer is disabled, etc.</div>
<div style><br></div><div style>That really reduces the necessary magic to providing a hook to disable the header itself when not compiled with a suitably recent Clang. That's why I had wondered about Compiler.h. We might end up with:</div>
<div style><br></div><div style>#if LLVM_ENABLE_SANITIZER_ANNOTATIONS</div><div style>  __msan_annotate_....();</div><div style>#endif</div><div style><br></div><div style>as the user code, Compiler.h providing the enable macro, and the user code including the appropriate header and annotation call.</div>
<div style><br></div><div style>Then the annotation call itself can be set up to compile away in the absence of the sanitizer...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
><br>
>><br>
>>>   Nick Lewycky (who added Valgrind.*), WDYT?<br>
>>><br>
>>> <a href="http://llvm-reviews.chandlerc.com/D336" target="_blank" class="cremed">http://llvm-reviews.chandlerc.com/D336</a><br>
>>> _______________________________________________<br>
>>> llvm-commits mailing list<br>
>>> <a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>><br>
><br>
</div></div></blockquote></div><br></div></div>