Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6bda7b

Browse filesBrowse files
committed
Accept /Fo and -Fo in -fmodule-output when running under CL mode
1 parent 4f4e2ab commit b6bda7b
Copy full SHA for b6bda7b

File tree

Expand file treeCollapse file tree

1 file changed

+20
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+20
-1
lines changed

‎clang/lib/Driver/Driver.cpp

Copy file name to clipboardExpand all lines: clang/lib/Driver/Driver.cpp
+20-1Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6097,10 +6097,29 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
60976097
}
60986098

60996099
llvm::PrettyStackTraceString CrashInfo("Computing output path");
6100+
61006101
// Output to a user requested destination?
61016102
if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) {
6102-
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
6103+
bool IsCLNonPCH =
6104+
IsCLMode() && !C.getArgs().hasArg(options::OPT__SLASH_Yc) &&
6105+
(isa<PreprocessJobAction>(JA) || isa<PrecompileJobAction>(JA));
6106+
bool HasAnyOutputArg = C.getArgs().hasArg(
6107+
options::OPT_o, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON);
6108+
6109+
Arg *FinalOutput = nullptr;
6110+
if (IsCLNonPCH && HasAnyOutputArg) {
6111+
FinalOutput = C.getArgs().getLastArg(
6112+
options::OPT_o, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON);
6113+
} else if (IsCLNonPCH) {
6114+
FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_Fo,
6115+
options::OPT__SLASH_Fo_COLON);
6116+
} else {
6117+
FinalOutput = C.getArgs().getLastArg(options::OPT_o);
6118+
}
6119+
6120+
if (FinalOutput) {
61036121
return C.addResultFile(FinalOutput->getValue(), &JA);
6122+
}
61046123
}
61056124

61066125
// For /P, preprocess to file named after BaseInput.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.