[PATCH] clang-cl: Choose executable name base on input name or /Fe

Hans Wennborg hans at chromium.org
Mon Aug 12 13:56:35 PDT 2013


  Thanks for looking! New patch coming up.


================
Comment at: lib/Driver/Driver.cpp:398
@@ +397,3 @@
+
+    if (A->getValue()[0] == '\0') {
+      // It has to have a value.
----------------
Reid Kleckner wrote:
> grumble grumble getValue() returns a C string.
Yeah :/

================
Comment at: lib/Driver/Driver.cpp:1660
@@ +1659,3 @@
+      SmallString<128> Filename = BaseName;
+      if (llvm::sys::path::has_extension(Filename.str()))
+        Filename = Filename.substr(0, Filename.rfind("."));
----------------
Reid Kleckner wrote:
> This can be path::replace_extension()
Thanks! I'll use that.

================
Comment at: lib/Driver/Driver.cpp:1650
@@ +1649,3 @@
+  } else if (JA.getType() == types::TY_Image &&
+      C.getArgs().hasArg(options::OPT__SLASH_Fe)) {
+    // The /Fe flag names the linked file.
----------------
Reid Kleckner wrote:
> Indent seems off
Done.

================
Comment at: lib/Driver/Driver.cpp:401
@@ +400,3 @@
+      Diag(clang::diag::err_drv_missing_argument) << A->getSpelling() << 1;
+      C->getArgs().eraseArg(options::OPT__SLASH_Fe);
+    }
----------------
Reid Kleckner wrote:
> Fe can actually name a directory in the same way as Fo.  The basename of the image is taken from the first source file, so you can do something like:
> cl /Fedir\ myapp.cpp srcs.cpp ...
Rats, I fail at reading the docs again. I'll fix this.


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



More information about the cfe-commits mailing list