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

Hans Wennborg hans at chromium.org
Tue Sep 10 10:54:15 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);
----------------
Reid Kleckner wrote:
> hasArg is overloaded to take multiple ids.
Ah, yes. Fixed.

================
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);
----------------
Reid Kleckner wrote:
> You can also use the overload here.
Done.

================
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",     "")
----------------
Reid Kleckner wrote:
> It seems weird that we have a custom dll filetype here when both dylibs and shared objects are covered by TY_Image.
Right, this was just to be able to get the name from types::getTypeTempSuffix(), but as you point out below it's probably less messy to just let MakeCLOutputFilename() handle it.

================
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)) {
----------------
Reid Kleckner wrote:
> 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.
Right, I'll do that.


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



More information about the cfe-commits mailing list