<div dir="ltr">This is not really related to how abstract scope works. I was browsing through the code and tried to figure out the usage of DeadFunScopeMap.<div>I noticed that the created lexical scope "Scope" is only used in <span style="font-size:13px;font-family:arial,sans-serif">SPCU->constructVariableDIE(&</span><span style="font-size:13px;font-family:arial,sans-serif">NewVar, Scope->isAbstractScope())</span></div>
<div><font face="arial, sans-serif">and Scope->isAbstractScope() should be false from the creation, so we can replace it with false. Once that is done, Scope is not used any where,</font></div><div><font face="arial, sans-serif">so we can remove it and then remove the </font><span style="font-family:arial,sans-serif;font-size:13px">DeadFnScopeMap.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Manman</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Oct 22, 2013 at 2:09 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ur? Could you elaborate more here on the abstract scope thing?<br>
<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Oct 22, 2013 at 1:59 PM, Manman Ren <<a href="mailto:manman.ren@gmail.com">manman.ren@gmail.com</a>> wrote:<br>
> Author: mren<br>
> Date: Tue Oct 22 15:59:19 2013<br>
> New Revision: 193196<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=193196&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=193196&view=rev</a><br>
> Log:<br>
> Debug Info: code clean up.<br>
><br>
> Remove unnecessary creation of LexicalScope in collectDeadVariables.<br>
> The created LexicialScope was only used to get isAbstractScope, which<br>
> should be false from the creation:<br>
> "new LexicalScope(NULL, DIDescriptor(SP), NULL, false);".<br>
><br>
> We can also remove a DenseMap that holds the created LexicalScopes.<br>
><br>
> Modified:<br>
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=193196&r1=193195&r2=193196&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=193196&r1=193195&r2=193196&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Oct 22 15:59:19 2013<br>
> @@ -969,7 +969,6 @@ void DwarfDebug::computeInlinedDIEs() {<br>
> // Collect info for variables that were optimized out.<br>
> void DwarfDebug::collectDeadVariables() {<br>
> const Module *M = MMI->getModule();<br>
> - DenseMap<const MDNode *, LexicalScope *> DeadFnScopeMap;<br>
><br>
> if (NamedMDNode *CU_Nodes = M->getNamedMetadata("<a href="http://llvm.dbg.cu" target="_blank">llvm.dbg.cu</a>")) {<br>
> for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {<br>
> @@ -987,10 +986,6 @@ void DwarfDebug::collectDeadVariables()<br>
> if (Variables.getNumElements() == 0)<br>
> continue;<br>
><br>
> - LexicalScope *Scope =<br>
> - new LexicalScope(NULL, DIDescriptor(SP), NULL, false);<br>
> - DeadFnScopeMap[SP] = Scope;<br>
> -<br>
> // Construct subprogram DIE and add variables DIEs.<br>
> CompileUnit *SPCU = CUMap.lookup(TheCU);<br>
> assert(SPCU && "Unable to find Compile Unit!");<br>
> @@ -1004,13 +999,12 @@ void DwarfDebug::collectDeadVariables()<br>
> continue;<br>
> DbgVariable NewVar(DV, NULL, this);<br>
> if (DIE *VariableDIE =<br>
> - SPCU->constructVariableDIE(&NewVar, Scope->isAbstractScope()))<br>
> + SPCU->constructVariableDIE(&NewVar, false))<br>
> SPDIE->addChild(VariableDIE);<br>
> }<br>
> }<br>
> }<br>
> }<br>
> - DeleteContainerSeconds(DeadFnScopeMap);<br>
> }<br>
><br>
> // Type Signature [7.27] and ODR Hash code.<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>