<div dir="ltr">On Wed, Sep 4, 2013 at 10:10 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="im">On Fri, Aug 30, 2013 at 10:45 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br></div><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><br>
<br>
================<br>
Comment at: lib/Sema/SemaLambda.cpp:101<br>
@@ -98,1 +100,3 @@<br>
+        (isa<FunctionDecl>(CurContext) &&<br>
+         Context.getTargetInfo().getCXXABI().isMicrosoft())) {<br>
       ManglingContextDecl = 0;<br>
----------------<br>
</div><div>Eli Friedman wrote:<br>
> Why do you need to number anything in a function which isn't inline?  CodeGen can mangle static variables etc.  however it wants because they aren't externally visible.<br>
</div>I'm using these to number bits in a bitfield, not to mangle.  I have to use this mechanism to number the bits of inline functions, so it makes sense to use it to number bits of non inline functions too.  Otherwise I have to add back the CXXABIFunctionState code I had in the first version of this patch.<br>


<br>
I'm having a very hard time extracting this function from Sema and moving it over to AST/ItaniumCXXABI.cpp as John suggested.  It accesses a bunch of Sema fields.  Do you have any thoughts on how this should look in the long run?<br>

</blockquote><div><br></div></div><div>Any thoughts on this?  This is needed to avoid double initialization of llvm::outs/errs(), and factoring this one check out will require a massive migration of Eli's Itanium logic from Sema to AST.</div>

<div><br></div></div></div></div></blockquote><div><br></div><div>The Itanium ABI code actually uses two numbering schemes: one for externally-visible stuff, and one for non-exernally visible stuff.  Not sure if you want to go that route.  See the beginning of the definition of "class ItaniumMangleContext" for how it numbers non-externally-visible stuff.  The idea is that we can avoid tracking the numbering in the AST for declarations where the numbers don't matter.  (Also, it involved changing less code when I implemented it.)</div>
<div><br></div><div>If you want to, I'm fine with leaving that check as-is.</div><div><br></div><div>(I haven't actually reviewed the rest of the patch.)</div><div><br></div><div>-Eli</div></div></div></div>