<div dir="ltr"><div dir="ltr">Wow, I don't know how I missed that. I touched the codeview parts of this a few weeks ago in r344393, and I looked at DICompileUnit, but the field is called "Flags" and it didn't occur to me that those would be *compiler* flags. Today I learned. I knew we wanted this, I just didn't know it was implemented.</div><div dir="ltr"><br></div><div>With that in mind, if you want to embed the command line into the object file separately from the debug info, I guess it's reasonable to put it in the metadata in two places: once in the DICompileUnit and again in the named metadata. It helps keep separate concerns separate.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 1:14 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Nov 13, 2018, at 1:07 PM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br>
> <br>
> Overall, I think we should do this. It's one of the most popular out of tree extensions that people make to LLVM and clang, and we want it for codeview anyway.<br>
<br>
Why isn't OPT_dwarf_debug_flags good enough for codeview?<br>
<br>
-- adrian<br>
<br>
> We currently don't emit a command line there. Other than that, I have some questions about how to do it.<br>
> <br>
> How will you associate the command line with the compilation unit to deal with regular (fat, not thin) LTO? It looks like you don't:<br>
> assert(N->getNumOperands() == 1 &&<br>
> "llvm.commandline metadata entry can have only one operand");<br>
> <br>
> IR linking will concatenate the named metadata nodes into a list of all the command lines. What should the semantics be? During regular object linking, I assume the command lines are discarded. Maybe just code that up?<br>
> <br>
> On Tue, Nov 13, 2018 at 12:27 PM via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Hi llvm-dev,<br>
> <br>
> I have an implementation of -frecord-gcc-switches ready for Clang, and a <br>
> named metadata node seemed like the correct way to approach this on the <br>
> LLVM side. I have a review at <a href="https://reviews.llvm.org/D54487" rel="noreferrer" target="_blank">https://reviews.llvm.org/D54487</a> which <br>
> discusses some of the differences in implementation vs. GCC. A change to <br>
> the set of "special" named metadata nodes seems like something that <br>
> warrants an llvm-dev post, and I was not sure who specifically would be <br>
> interested in reviewing the changes.<br>
> <br>
> Thanks,<br>
> Scott<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div>