diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-10-11 02:30:56 +0000 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-10-11 02:30:56 +0000 |
| commit | 11f6be1ce81df7da5d2f37119777d0ad6afa1115 (patch) | |
| tree | 3b87ca65de68d062b5fa8f8fd0248ae9faf08094 /clang/lib/CodeGen | |
| parent | 89acd1e7efb3bbf4dc16fcad83046f5d7bad6b87 (diff) | |
| download | bcm5719-llvm-11f6be1ce81df7da5d2f37119777d0ad6afa1115.tar.gz bcm5719-llvm-11f6be1ce81df7da5d2f37119777d0ad6afa1115.zip | |
lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.
It enables clang to compile Mingw's headers.
llvm-svn: 116184
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 12c8f7919fa..805a82747da 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -974,7 +974,9 @@ CodeGenModule::GetOrCreateLLVMGlobal(llvm::StringRef MangledName, if (D->getStorageClass() == SC_PrivateExtern) GV->setVisibility(llvm::GlobalValue::HiddenVisibility); - if (D->hasAttr<WeakAttr>() || + if (D->hasAttr<DLLImportAttr>()) + GV->setLinkage(llvm::GlobalValue::DLLImportLinkage); + else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); |

