<div dir="ltr">I've submitted a patch: <a href="https://reviews.llvm.org/D38306">https://reviews.llvm.org/D38306</a><div><br></div><div>Please let me know if it addressed your issues.</div><div><br></div><div>thanks...</div><div>don</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 26, 2017 at 10:30 PM, Mehdi AMINI via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2017-09-26 11:54 GMT-07:00 Matthias Braun via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_2789381745766137961HOEnZb"><div class="m_2789381745766137961h5"><br>
> On Sep 26, 2017, at 7:04 AM, David Keaton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> On 09/25/2017 06:47 PM, David Keaton via llvm-dev wrote:<br>
>> On 09/25/2017 06:19 PM, Matthias Braun wrote:<br>
>>><br>
>>>> On Sep 25, 2017, at 6:03 PM, David Keaton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>>>><br>
>>>> On 09/25/2017 02:53 PM, Matthias Braun via llvm-dev wrote:<br>
>>> In the meantime `cmake -DCMAKE_CXX_FLAGS="-DLLVM_ENAB<wbr>LE_DUMP"` should do the trick.<br>
>>      Thank you.  That was the flag we needed.<br>
>>      Unfortunately, when I tried this just now, I found that the declaration of llvm::MachineRegisterInfo::dum<wbr>pUses() in include/llvm/CodeGen/MachineRe<wbr>gisterInfo.h is missing the check against LLVM_ENABLE_DUMP.  It has only<br>
>> #ifndef NDEBUG<br>
>> which causes the build to fail because the definition in lib/CodeGen/MachineRegisterInf<wbr>o.cpp is guarded by this.<br>
>> #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)<br>
><br>
>     Unfortunately, this was only the beginning.  I tried updating the header file to test LLVM_ENABLE_DUMP as well, and when I did that, the build hit another such case, which I tried fixing, and then it hit another, and another.  Here is what I have found so far that would need to be fixed under the current arrangement.<br>
><br>
> LLVM_ENABLE_DUMP added to:<br>
><br>
> include/llvm/CodeGen/MachineRe<wbr>gisterInfo.h<br>
>       dumpUses()<br>
><br>
> include/llvm/CodeGen/MachineSc<wbr>heduler.h<br>
>       dumpScheduledState()<br>
><br>
> include/llvm/CodeGen/TargetSch<wbr>edule.h<br>
>       getResourceName()<br>
><br>
> include/llvm/MC/MCSchedule.h<br>
>       Name<br>
><br>
> utils/TableGen/SubtargetEmitte<wbr>r.cpp<br>
>       emitted code inside EmitSchedModel()<br>
><br>
> Unknown location in AArch64<br>
>       This is not the end.  I just lost track of what to change at this point.<br>
</div></div>I guess that was to be expected with an option that didn't even have a cmake flag. I would propose to just check for LLVM_ENABLE_DUMP in the sourcecode and move the logic that debug builds have dump() methods to the cmake side of things to simplify things. But I think that needs agreement and someone to write a patch.<br>
<br>
+CC some of the people who I believe made the decision for the current style.<br></blockquote><div><br></div></div></div><div>The usual proper way to expose such options (IIRC) is to define such config options in the llvm-config.h (or config.h I forgot which one) during the CMake configuration, and clients are supposed to use the definition from these header that comes with the pre-built LLVM to conditionally compile out their calls to these.</div><span class=""><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
><br>
>     Perhaps it would be easier to revert the change that hid the dump() methods.  That would have another advantage as well.  Before LLVM 5.0.0, Chapel had the ability to link with an existing pre-built LLVM if it was installed on the system.</span> With LLVM 5.0.0, we cannot do that any longer because we need to compile with LLVM_ENABLE_DUMP defined.  It takes 10x longer to compile LLVM than it does to compile the rest of Chapel, so it is quite a burden to require a recompilation of LLVM to get the dump() methods.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Again: I consider client code calling dump() to be a misuse.<br></blockquote><div><br></div></span><div>I tend to agree, but there is a principled / robust way to have a client support debug features alongside with a debug build of LLVM (the config.h option I mentioned above).</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div><div><br></div></font></span></div></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>