[PATCH] Unify handling guard variables in the Itanium C++ ABI

Justin Bogner mail at justinbogner.com
Tue Apr 22 18:58:42 PDT 2014


John McCall <rjmccall at apple.com> writes:
> On Apr 22, 2014, at 9:57 AM, Justin Bogner <mail at justinbogner.com> wrote:
>> We previously treated ARM separately from the generic Itanium ABI for
>> initializing guard variables.  This code duplication led to things like
>> the ARM path missing the memory barrier for threadsafe handling, and a
>> highly misleading comment about how we were (mis)using the generic ABI
>> for ARM64 when really it went through the ARM codepath.
>> 
>> This unifies the two code paths.  Functionally, this changes the ARM and
>> ARM64 codepath to use one byte loads instead of 4 and 8, respectively,
>> and adds the missing atomic acquire to these loads.  Other architectures
>> are unchanged.
>> 
>> Okay to commit?
>
> +  llvm::Value *V =
> +      UseARMGuardVarABI && !useInt8GuardVariable
> +          ? Builder.CreateAnd(LI, llvm::ConstantInt::get(CGM.Int8Ty, 1))
> +          : LI;
>
> Parenthesize the condition here, please.
>
> Otherwise looks good.

Reid Kleckner <rnk at google.com> writes:
> Looks good.

r206937. Thanks!



More information about the cfe-commits mailing list