[PATCH] clang-cl: Implement support for the /Fo option
Hans Wennborg
hans at chromium.org
Tue Aug 6 14:38:42 PDT 2013
================
Comment at: include/clang/Driver/CLCompatOptions.td:86
@@ -85,1 +85,3 @@
+def _SLASH_Fo : CLJoinedOrSeparate<"Fo">,
+ HelpText<"Specifiy object file or directory">, MetaVarName<"<filename>">;
----------------
Reid Kleckner wrote:
> I don't think we should support the separate form of /Fo, since cl.exe doesn't either.
Ah, I didn't notice that. Will do.
================
Comment at: include/clang/Driver/CLCompatOptions.td:87
@@ -86,1 +86,3 @@
+def _SLASH_Fo : CLJoinedOrSeparate<"Fo">,
+ HelpText<"Specifiy object file or directory">, MetaVarName<"<filename>">;
def _SLASH_Tc : CLJoinedOrSeparate<"Tc">, HelpText<"Specify a C source file">,
----------------
Reid Kleckner wrote:
> We should document that a trailing slash is what implies a directory, hopefully with less than 70-ish characters.
I'll try :)
================
Comment at: lib/Driver/Driver.cpp:1620
@@ +1619,3 @@
+ Filename.append(".");
+ // FIXME: For clang-cl, we want .obj rather than .o for object files.
+ Filename.append(types::getTypeTempSuffix(types::TY_Object));
----------------
Reid Kleckner wrote:
> We're already dominated by a check for /Fo, which implies clang-cl mode, so I'd just hardcode this to append(".obj") and get this right on the first commit. No need to go back and change the test.
Yes, but clang-cl mode doesn't necessarily imply /Fo. It would be weird if we produced .obj files with /Fo and .o otherwise.
I think it might be better to fix this in a separate patch.
http://llvm-reviews.chandlerc.com/D1302
More information about the cfe-commits
mailing list