Skip to content

Commit 1a471fe

Browse files
committed
Use IsCLMode to guard cl-style output argument presence
1 parent 3a84b59 commit 1a471fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6099,8 +6099,15 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
60996099
llvm::PrettyStackTraceString CrashInfo("Computing output path");
61006100
// Output to a user requested destination?
61016101
if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) {
6102-
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON))
6102+
Arg *FinalOutput =
6103+
IsCLMode()
6104+
? C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo,
6105+
options::OPT__SLASH_Fo_COLON)
6106+
: C.getArgs().getLastArg(options::OPT_o);
6107+
6108+
if (FinalOutput != nullptr) {
61036109
return C.addResultFile(FinalOutput->getValue(), &JA);
6110+
}
61046111
}
61056112

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

0 commit comments

Comments
 (0)