summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-09-08 01:44:27 +0000
committerJohn McCall <rjmccall@apple.com>2010-09-08 01:44:27 +0000
commit68ff03728a5036dbad626a93144873a1470d27fd (patch)
tree7c3a6081c18495776e7f242038ee317cc606041f /clang/lib/CodeGen/CGDecl.cpp
parent64d842ec726ffba3229360822782a7f4704cb7a2 (diff)
downloadbcm5719-llvm-68ff03728a5036dbad626a93144873a1470d27fd.tar.gz
bcm5719-llvm-68ff03728a5036dbad626a93144873a1470d27fd.zip
Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 97c03410871..965400135e3 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud