<div dir="ltr">Or, instead of lobbying for llvm to always define dump(), you could lobby for it to enabled by default.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 25, 2017 at 2:41 PM, Dibyendu Majumdar <span dir="ltr"><<a href="mailto:mobile@majumdar.org.uk" target="_blank">mobile@majumdar.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Don,<br>
<span class=""><br>
On 25 September 2017 at 22:37, Don Hinton <<a href="mailto:hintonda@gmail.com">hintonda@gmail.com</a>> wrote:<br>
> It'll work in release builds -- just rebuild llvm with LLVM_ENABLE_DUMP<br>
> enabled.<br>
><br>
<br>
</span>That assumes one has control over the LLVM build options.<br>
<span class="im HOEnZb"><br>
<br>
> On Mon, Sep 25, 2017 at 2:35 PM, Dibyendu Majumdar <<a href="mailto:mobile@majumdar.org.uk">mobile@majumdar.org.uk</a>><br>
> wrote:<br>
>><br>
</span><div class="HOEnZb"><div class="h5">>> On 25 September 2017 at 22:29, Don Hinton <<a href="mailto:hintonda@gmail.com">hintonda@gmail.com</a>> wrote:<br>
>> > Thanks for reporting this.<br>
>> ><br>
>> > Looks like this one was missed -- the declaration should have been<br>
>> > #ifdef'd<br>
>> > away along with the definition.  A quick grep indicates there are a<br>
>> > number<br>
>> > of them that need to be fixed.<br>
>> ><br>
>> > Here's the original commit:<br>
>> ><br>
>> > commit 88d207542b618ca6054b24491ddd67<wbr>f8ca397540<br>
>> > Author: Matthias Braun <<a href="mailto:matze@braunis.de">matze@braunis.de</a>><br>
>> > Date:Â Â Sat Jan 28 02:02:38 2017 +0000<br>
>> ><br>
>> >Â Â Â Cleanup dump() functions.<br>
>> ><br>
>> >Â Â Â We had various variants of defining dump() functions in LLVM.<br>
>> > Normalize<br>
>> >Â Â Â them (this should just consistently implement the things discussed<br>
>> > in<br>
>> >Â Â Â <a href="http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/cfe-dev/2014-<wbr>January/034323.html</a><br>
>> ><br>
>> >Â Â Â For reference:<br>
>> >Â Â Â - Public headers should just declare the dump() method but not use<br>
>> >Â Â Â Â LLVM_DUMP_METHOD or #if !defined(NDEBUG) ||<br>
>> > defined(LLVM_ENABLE_DUMP)<br>
>> >Â Â Â - The definition of a dump method should look like this:<br>
>> >Â Â Â Â #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)<br>
>> >Â Â Â Â LLVM_DUMP_METHOD void MyClass::dump() {<br>
>> >Â Â Â Â Â // print stuff to dbgs()...<br>
>> >Â Â Â Â }<br>
>> >Â Â Â Â #endif<br>
>> ><br>
>> >Â Â Â git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@293359" rel="noreferrer" target="_blank">https://llvm.org/svn/llvm-<wbr>project/llvm/trunk@293359</a><br>
>> > 91177308-0d34-0410-b5e6-<wbr>96231b3b80d8<br>
>> ><br>
>><br>
>> I would argue that removing dump() is the wrong thing to do even in<br>
>> Release builds. I am using LLVM as a JIT. In this use case, it is<br>
>> essential that one can inspect the IR at runtime. Perhaps in the AOT<br>
>> case dump() is not used in release versions but that is not the case<br>
>> in a JIT use case.<br>
>><br>
>> Unless there is an equivalent alternative to dump() that is always<br>
>> available.<br>
>><br>
>><br>
<br>
Regards<br>
Dibyendu<br>
</div></div></blockquote></div><br></div>