[PATCH] [ms-cxxabi] Implement guard variables for static initialization

Reid Kleckner rnk at google.com
Tue Aug 27 13:20:22 PDT 2013


On Tue, Aug 27, 2013 at 11:55 AM, John McCall <rjmccall at gmail.com> wrote:

> On Aug 20, 2013, at 4:59 PM, Reid Kleckner <rnk at google.com> wrote:
> >    - Use MangleNumeringContext for the guard variable bit index.
>
> This mostly looks good.
>
> +  virtual ~MangleNumberingContext();
> +
>
> You should leave this defined inline.  No need to worry about anchoring
> the v-table because, as an abstract class, it’s likely that all references
> to the v-table will be dropped after optimization.
>

OK.  That was my concern. :)


>      //  -- the bodies of non-exported nonspecialized template functions
>      //  -- the bodies of inline functions
> +    //  -- the bodies of regular functions in the Microsoft ABI
>      if ((IsInNonspecializedTemplate &&
>           !(ManglingContextDecl && isa<ParmVarDecl>(ManglingContextDecl)))
> ||
> -        isInInlineFunction(CurContext)) {
> +        isInInlineFunction(CurContext) ||
> +        (isa<FunctionDecl>(CurContext) &&
> +         Context.getTargetInfo().getCXXABI().isMicrosoft())) {
>        ManglingContextDecl = 0;
>        return &Context.getManglingNumberContext(DC);
>
> You should just pull this entire decision into the AST CXXABI.
>

The AST CXXABI interface isn't exposed to Sema.  Currently, Sema asks the
ASTContext for things like the default method calling convention, and the
context forwards the call into CXXABI.  I'll go this route for now.

Should I move lib/AST/CXXABI.h up to include/clang/AST/CXXABI.h as a
followup?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130827/f21d8d75/attachment.html>


More information about the cfe-commits mailing list