diff options
author | John McCall <rjmccall@apple.com> | 2010-09-08 01:44:27 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-09-08 01:44:27 +0000 |
commit | 5cd91b513455fd7753e8815b54f0a49bbca6602d (patch) | |
tree | e2aec9abdce6a7183211e487e100a98b172c14c4 /lib/CodeGen/CGDecl.cpp | |
parent | 607a1788d9529c8e8494ac528764aa2c678a1a97 (diff) |
Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 97c0341087..965400135e 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -189,12 +189,12 @@ CodeGenFunction::AddInitializerToGlobalBlockVarDecl(const VarDecl &D, if (!Init) { if (!getContext().getLangOptions().CPlusPlus) CGM.ErrorUnsupported(D.getInit(), "constant l-value expression"); - else { + else if (Builder.GetInsertBlock()) { // Since we have a static initializer, this global variable can't // be constant. GV->setConstant(false); - - EmitStaticCXXBlockVarDeclInit(D, GV); + + EmitCXXStaticLocalInit(D, GV); } return GV; } |