<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 26, 2015 at 12:19 AM, Amjad Aboud <span dir="ltr"><<a href="mailto:amjad.aboud@intel.com" target="_blank">amjad.aboud@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aaboud added inline comments.<br>
<span class=""><br>
================<br>
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.h:239<br>
@@ +238,3 @@<br>
+  // Collection of abstract global variables.<br>
+  DenseMap<const MDNode *, DIE *> AbstractGlobalVariables;<br>
+  SmallVector<std::pair<const MDNode *, DIE *>, 32> ConcreteGlobalVariables;<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> I can't quite follow it - why are these two data structures necessary now (but weren't necessary prior to your proposed change)?<br>
</span>In my original solution I did not consider optimized code, especially inline functions.<br>
Now as I need to take care of these cases, it led us to the need for handling function static variables for function been inlined. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Notice that in the today implementation, where the function static variable is always associated to the function regardless of the lexical block it is defined in, the function static variable is being defined once even when the function is being inlined.<br></blockquote><div><br class="Apple-interchange-newline">OK, so that sounds like possibly an orthogonal bug? It'd be nice to separate out the fix for it<br><br>It seems a bit weird to me that we'd even want the variable in the inlined_subroutine. I'd want to see what GCC does here - but it may be simpler to just defer that whole discussion of what, if anything, is the right thing to do there, to a separate email thread to keep things clear/separate?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This means that you will not have access to that variable from the caller function.<br>
<br>
With this patch, I am not just solving the static lexical block issue but also assure have access to that static variable from the caller function.<br>
<br>
If you think that I should not bother solving this debugging issue, I might be able to do less changes and keep the current behavior (of losing debug info when inline).<br>
<br>
What do you think?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11180&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=cqvednervQTXng91YiKwYmw5dfs1hbLg7lI6pWGLTY4&s=yTuUZ6Xvkg_RpqyzPYOZBwtbyFUJc7cCufPQ6NPZ0M4&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11180</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>