<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 22, 2015 at 3:32 PM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David, it'd be good idea to introduce the attribute to mark UNUSED<br>
only with -Asserts. Like "LLVM_ATTRIBUTE_USED_DEBUG"?<br></blockquote><div><br>SGTM<br> </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>
2015-02-23 6:03 GMT+09:00 David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>>:<br>
><br>
><br>
> On Sun, Feb 22, 2015 at 1:58 AM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com">geek4civic@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Author: chapuni<br>
>> Date: Sun Feb 22 03:58:19 2015<br>
>> New Revision: 230169<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230169&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=230169&view=rev</a><br>
>> Log:<br>
>> RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as<br>
>> LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]<br>
>><br>
>> Modified:<br>
>>     llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp<br>
>><br>
>> Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=230169&r1=230168&r2=230169&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=230169&r1=230168&r2=230169&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp<br>
>> (original)<br>
>> +++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Sun Feb<br>
>> 22 03:58:19 2015<br>
>> @@ -300,7 +300,7 @@ analyzeParsePointLiveness(DominatorTree<br>
>>  }<br>
>><br>
>>  /// True iff this value is the null pointer constant (of any pointer<br>
>> type)<br>
>> -static bool isNullConstant(Value *V) {<br>
>> +static bool LLVM_ATTRIBUTE_UNUSED isNullConstant(Value *V) {<br>
><br>
><br>
> I'm inclined to wrap such functions in 'ifndef NDEBUG' rather than use<br>
> LLVM_ATTRIBUTE_UNUSED to ensure that if this becomes unused in assertions,<br>
> we can remove it (rather than it lying around unused indefinitiely). How do<br>
> other people feel about this?<br>
><br>
> Perhaps we could change LLVM_ATTRIBUTE_UNUSED to only expand to the<br>
> attribute in non-asserts builds so we'd still get the warning in an asserts<br>
> build that no longer called the function? (at which point maybe have a<br>
> different macro name for this purpose?)<br>
><br>
>><br>
>>    return isa<Constant>(V) && isa<PointerType>(V->getType()) &&<br>
>>           cast<Constant>(V)->isNullValue();<br>
>>  }<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>