summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-06 09:44:32 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-06 09:44:32 +0000
commitcdf7ef5437f2cd76bd6b0246cd11b1837d79104e (patch)
tree33ffe1037fdadbfadd82e5f2348e45edb53e4c27 /clang/lib/CodeGen/CGDecl.cpp
parent8b0a71fc315f561e3d9889c924fb2618ffdf5a27 (diff)
downloadbcm5719-llvm-cdf7ef5437f2cd76bd6b0246cd11b1837d79104e.tar.gz
bcm5719-llvm-cdf7ef5437f2cd76bd6b0246cd11b1837d79104e.zip
Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after linkage and visibility have been set on the global. Also, don't emit a guard unless the variable actually ends up with vague linkage, and don't use thread-safe statics in any case. llvm-svn: 118336
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 5ac8508375f..02da0a533b8 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -196,7 +196,7 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const VarDecl &D,
// be constant.
GV->setConstant(false);
- EmitCXXStaticLocalInit(D, GV);
+ EmitCXXGuardedInit(D, GV);
}
return GV;
}
OpenPOWER on IntegriCloud