[PATCH] Allow dllimport/dllexport on inline functions and get the linkage right

Hans Wennborg hans at chromium.org
Wed May 14 17:24:30 PDT 2014


================
Comment at: lib/CodeGen/CodeGenModule.cpp:1967
@@ +1966,3 @@
+  if (D->hasAttr<DLLExportAttr>()) {
+    DiscardableODRLinkage = llvm::GlobalVariable::WeakODRLinkage;
+    NonDiscardableODRLinkage = llvm::GlobalVariable::WeakODRLinkage;
----------------
Reid Kleckner wrote:
> So, this is weird.  We're saying that for discardable things, we need to use a linkage that prohibits discarding them.
> 
> Maybe it would be better to change the GVA linkage of dllexported things?
Yeah, fixing the GVA linkage is probably the right thing to do. I'll give it a shot.

================
Comment at: test/CodeGen/dllexport.cpp:1
@@ +1,2 @@
+// RUN: %clang_cc1 -triple i686-pc-win32 -x c++ -O2 -disable-llvm-optzns -emit-llvm < %s | FileCheck %s
+
----------------
Reid Kleckner wrote:
> This should be in test/CodeGenCXX
Done.

================
Comment at: test/CodeGen/dllimport.cpp:1
@@ +1,2 @@
+// RUN: %clang_cc1 -triple i686-pc-win32 -x c++ -O2 -disable-llvm-optzns -emit-llvm < %s | FileCheck %s
+
----------------
Reid Kleckner wrote:
> This should be in test/CodeGenCXX
Done.

http://reviews.llvm.org/D3772






More information about the cfe-commits mailing list