<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 29, 2015 at 2:17 AM, Alex <span dir="ltr"><<a href="mailto:alexinbeijing@gmail.com" target="_blank">alexinbeijing@gmail.com</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">Dear LLVM devs,<div><br></div><div>I'm just working on the LLVM assembler's handling of .file and .line directives. I've noticed some strange things and am wondering if there is a reason the code works the way it does.</div><div><br></div><div>1. MCContext keeps a map of number -> MCDwarfLineTable called MCDwarfLineTablesCUMap. However, as far as I can see, the only compilation unit number which is *ever* used is zero! If this is true, then the map is not serving any useful purpose.</div><div><br></div><div>What was the intention of the CU ID numbers? If multiple .file directives appear in the asm, each one should open a new "CU", is that not so?</div><div><br></div><div>2. Although it appears that each MCDwarfLineTable should be for a single compilation unit, MCDwarfLineTable has a *vector* called MCDwarfFiles (so each MCDwarfLineTable can have multiple files).</div><div><br></div><div>Although you can have references to multiple files in the same MCDwarfLineTable, it appears that the only one which is ever used is the first one! MCDwarfLineTable doesn't do any recordkeeping to remember which line number data belongs to which file, either.</div><div><br></div><div>------------------------</div><div><br></div><div>I can go through the code and clean up some of these inconsistencies, but I need to know how it is *intended* to work. Can someone explain?</div></div></blockquote><div><br>I /think/ a lot of the complexity you're seeing is there for the non-asm debug info case (look into how these data structures are used when emitting debug info for LTO, for example - when the debug info metadata in the IR describes multiple compile units, multiple files, etc)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,</div><div>Alex Dowad</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>