<div dir="ltr">Yes, my next step is to move DISubprogram::getContext to return a ScopeRef.<div>I actually like the suggestion of updating DIScope::getContext to return a ScopeRef (partially revert r190330) and I will submit a patch for that.</div>
<div><br></div><div>Thanks,</div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 9, 2013 at 2:11 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@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"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 9, 2013 at 2:05 PM, Manman Ren <span dir="ltr"><<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@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"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Mon, Sep 9, 2013 at 1:16 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@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"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Mon, Sep 9, 2013 at 12:23 PM, Manman Ren <span dir="ltr"><<a href="mailto:manman.ren@gmail.com" target="_blank">manman.ren@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mren<br>
Date: Mon Sep  9 14:23:58 2013<br>
New Revision: 190330<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=190330&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=190330&view=rev</a><br>
Log:<br>
Debug Info: move DIScope::getContext to DwarfDebug.<br></blockquote><div><br></div></div><div>This seems a little unfortunate. Though admittedly it's not actually a feature of all DIScopes to have, themselves, a context.<br>



<br>What would happen if DIScope::getContext returned a DIScopeRef instead of a DIScope? It shouldn't need the map then, right? Seems like it would be a smaller change.</div></div></div></div></blockquote></div><div>

It is possible to return DIScopeRef if we add an constructor to build DIScopeRef from DIScope.</div>
<div>I will check how easy this option is.</div></div></div></div></blockquote><div><br></div></div></div><div>Only temporarily, though, right? Since at some point all contexts will have to be DIScopeRefs, since they may be DITypes (& thus may be type references) at which point this can be removed & DIScope::getContext will be written exactly as it was before, no extra conversions, etc, needed. <br>

<br>I would consider just doing all the context references in one go, but so long as you remember to come back & clean that conversion/constructor up once all the scope context references are migrated, that's OK.</div>

</div></div></div>
</blockquote></div><br></div>