]> granicus.if.org Git - clang/commitdiff
lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 11 Oct 2010 02:30:56 +0000 (02:30 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 11 Oct 2010 02:30:56 +0000 (02:30 +0000)
It enables clang to compile Mingw's headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 12c8f7919fa7b704efaddff7b94187e19048a253..805a82747da7873015a088b4504adb121a5ee310 100644 (file)
@@ -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);