[PATCH] Teach LTOModule to emit linker flags for dllexported symbols, plus interface cleanup.

Reid Kleckner rnk at google.com
Mon Jun 29 13:15:15 PDT 2015


lgtm

To my knowledge, the only client of the dependent lib API was the Sony linker. I think they should be able to tolerate this change by parsing defaultlib internally. I don't think ld64 will be affected.


================
Comment at: include/llvm-c/lto.h:296
@@ -293,1 +295,3 @@
  *
+ * Deprecated. Now returns an empty list.
+ *
----------------
"Now always returns null."?

================
Comment at: lib/CodeGen/TargetLoweringObjectFileImpl.cpp:995
@@ -994,3 @@
-getDepLibFromLinkerOpt(StringRef LinkerOption) const {
-  const char *LibCmd = "/DEFAULTLIB:";
-  if (LinkerOption.startswith(LibCmd))
----------------
Wow, this seems too case sensitive.

================
Comment at: test/CodeGen/X86/dllexport-x86_64.ll:74
@@ -73,31 +73,3 @@
 ; CHECK: .section .drectve
-; WIN32: " /EXPORT:Var1,DATA"
-; WIN32: " /EXPORT:Var2,DATA"
-; WIN32: " /EXPORT:Var3,DATA"
-; WIN32: " /EXPORT:WeakVar1,DATA"
-; WIN32: " /EXPORT:WeakVar2,DATA"
-; WIN32: " /EXPORT:f1"
-; WIN32: " /EXPORT:f2"
-; WIN32: " /EXPORT:lnk1"
-; WIN32: " /EXPORT:lnk2"
-; WIN32: " /EXPORT:weak1"
-; WIN32: " /EXPORT:alias"
-; WIN32: " /EXPORT:alias2"
-; WIN32: " /EXPORT:alias3"
-; WIN32: " /EXPORT:weak_alias"
-; WIN32: " /EXPORT:blob_alias"
-; MINGW: " -export:Var1,data"
-; MINGW: " -export:Var2,data"
-; MINGW: " -export:Var3,data"
-; MINGW: " -export:WeakVar1,data"
-; MINGW: " -export:WeakVar2,data"
-; MINGW: " -export:f1"
-; MINGW: " -export:f2"
-; MINGW: " -export:lnk1"
-; MINGW: " -export:lnk2"
-; MINGW: " -export:weak1"
-; MINGW: " -export:alias"
-; MINGW: " -export:alias2"
-; MINGW: " -export:alias3"
-; MINGW: " -export:weak_alias"
-; MINGW: " -export:blob_alias"
+; WIN32: " /EXPORT:f1 /EXPORT:f2 /EXPORT:lnk1 /EXPORT:lnk2 /EXPORT:weak1 /EXPORT:Var1,DATA /EXPORT:Var2,DATA /EXPORT:Var3,DATA /EXPORT:WeakVar1,DATA /EXPORT:WeakVar2,DATA /EXPORT:alias /EXPORT:alias2 /EXPORT:alias3 /EXPORT:weak_alias /EXPORT:blob_alias"
+; MINGW: " -export:f1 -export:f2 -export:lnk1 -export:lnk2 -export:weak1 -export:Var1,data -export:Var2,data -export:Var3,data -export:WeakVar1,data -export:WeakVar2,data -export:alias -export:alias2 -export:alias3 -export:weak_alias -export:blob_alias"
----------------
Can you use CHECK-SAME to keep the strings on separate lines like before? IMO it's easier to read and update.

http://reviews.llvm.org/D10548

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list