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

Yunzhong Gao Yunzhong_Gao at playstation.sony.com
Mon Jun 29 15:04:41 PDT 2015


================
Comment at: include/llvm-c/lto.h:286
@@ -285,1 +285,3 @@
+ * Deprecated. Now returns an empty list.
+ *
  * \since LTO_API_VERSION=8
----------------
I'm wondering whether it might be better to remove these two functions instead of changing their behaviors silently.

================
Comment at: lib/LTO/LTOModule.cpp:655
@@ -651,13 +654,3 @@
         MDString *MDOption = cast<MDString>(MDOptions->getOperand(ii));
-        // FIXME: Make StringSet::insert match Self-Associative Container
-        // requirements, returning <iter,bool> rather than bool, and use that
-        // here.
-        StringRef Op =
-            _linkeropt_strings.insert(MDOption->getString()).first->first();
-        StringRef DepLibName =
-            _target->getObjFileLowering()->getDepLibFromLinkerOpt(Op);
-        if (!DepLibName.empty())
-          _deplibs.push_back(DepLibName.data());
-        else if (!Op.empty())
-          _linkeropts.push_back(Op.data());
+        OS << " " << MDOption->getString();
       }
----------------
Is it safe to concatenate all the linker options into one? What if the #pragma comment(lib, ...) or #pragma comment(linker, ...) string also contains space characters?

http://reviews.llvm.org/D10548

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






More information about the llvm-commits mailing list