diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-18 15:55:13 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-18 15:55:13 +0000 |
commit | ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5 (patch) | |
tree | 0e5d398de6a617ade8213438b547087ac3e1ab5e /clang/lib/CodeGen/MicrosoftCXXABI.cpp | |
parent | dbb3e3e64f40098a74e1d337cfbc1212959fe832 (diff) | |
download | bcm5719-llvm-ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5.tar.gz bcm5719-llvm-ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5.zip |
Inherit dll attributes to static locals
This makes us handle static locals in exported/imported functions correctly.
Differential Revision: http://reviews.llvm.org/D4136
llvm-svn: 211173
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r-- | clang/lib/CodeGen/MicrosoftCXXABI.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index ffcf76eb421..ca2aaa2edf1 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1425,12 +1425,13 @@ void MicrosoftCXXABI::EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D, Out.flush(); } - // Create the guard variable with a zero-initializer. Just absorb linkage - // and visibility from the guarded variable. + // Create the guard variable with a zero-initializer. Just absorb linkage, + // visibility and dll storage class from the guarded variable. GI->Guard = new llvm::GlobalVariable(CGM.getModule(), GuardTy, false, GV->getLinkage(), Zero, GuardName.str()); GI->Guard->setVisibility(GV->getVisibility()); + GI->Guard->setDLLStorageClass(GV->getDLLStorageClass()); } else { assert(GI->Guard->getLinkage() == GV->getLinkage() && "static local from the same function had different linkage"); |