On Tue, Aug 20, 2013 at 11:30 AM, Reid Kleckner <[email protected]> wrote:
> On Mon, Aug 19, 2013 at 5:51 PM, Eli Friedman <[email protected]>wrote: > >> class MicrosoftFunctionState : public CXXABIFunctionState { >> public: >> MicrosoftFunctionState() : NumGuardedInitsEmitted(0), GuardGV(0) {} >> int NumGuardedInitsEmitted; >> llvm::GlobalVariable *GuardGV; >> }; >> >> This is very suspicious. For the Itanium ABI, to get this right, we have >> to track it in the AST. (See clang::MangleNumberingContext etc.) A >> testcase (which we messed up with the Itanium ABI until quite recently): >> >> int foo(); >> inline void f() { >> if (0) { >> static int x = foo(); >> } >> static int x = foo(); >> } >> void g() { f(); } >> > > Yeah, I get the bit numbers wrong. What I actually need to do is to > number all the static local VarDecls in a DeclContext based on source order > like this: > > inline void f() { > if (0) { > static int x = foo(); // 1 > } > static int x = foo(); // 2 > static int y = foo(); // 3 > static int z = foo(); // 4 > } > > Maybe what we should do here is ask the AST/CXXABI class to create the > ManglingNumberContext, and I can provide an implementation for the > Microsoft C++ ABI. Sound good? > That sounds like the right direction. > > --- > > By the way, lambdas are mangled totally differently. David knows more. > We think it's some kind of hash of the token stream that clang will > probably never be able to replicate. We may have to make up our own > mangling. > Really? Wow. (In the Itanium ABI, we number them in source order.) -Eli
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
