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

John McCall rjmccall at apple.com
Tue Apr 22 17:22:32 PDT 2014


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.

John.




More information about the cfe-commits mailing list