[PATCH] clang-cl: support building DLLs (PR17083)

Reid Kleckner rnk at google.com
Mon Sep 9 18:04:32 PDT 2013



================
Comment at: lib/Driver/Driver.cpp:1267
@@ +1266,3 @@
+  if (!LinkerInputs.empty()) {
+    bool DLL = Args.hasArg(options::OPT__SLASH_LD) ||
+               Args.hasArg(options::OPT__SLASH_LDd);
----------------
hasArg is overloaded to take multiple ids.

================
Comment at: lib/Driver/Driver.cpp:1658
@@ -1654,1 +1657,3 @@
+  } else if ((JA.getType() == types::TY_Image ||
+              JA.getType() == types::TY_dll) &&
              C.getArgs().hasArg(options::OPT__SLASH_Fe)) {
----------------
These conditionals seem less than ideal.  I'd rather remove TY_dll and use a helper factored out of MakeCLOutputFileName that checks the job type and the ArgList and picks the appropriate extension.

================
Comment at: lib/Driver/Tools.cpp:6591
@@ -6581,1 +6590,3 @@
 
+  bool DLL = Args.hasArg(options::OPT__SLASH_LD) ||
+             Args.hasArg(options::OPT__SLASH_LDd);
----------------
You can also use the overload here.

================
Comment at: include/clang/Driver/Types.def:93
@@ -92,2 +92,3 @@
 TYPE("dSYM",                     dSYM,         INVALID,         "dSYM",  "A")
+TYPE("dll",                      dll,          INVALID,         "dll",   "")
 TYPE("dependencies",             Dependencies, INVALID,         "d",     "")
----------------
It seems weird that we have a custom dll filetype here when both dylibs and shared objects are covered by TY_Image.


http://llvm-reviews.chandlerc.com/D1632



More information about the cfe-commits mailing list