Skip to content

Commit bc9b68d

Browse files
committed
Use IsCLMode to guard cl-style output argument presence
1 parent a9f9212 commit bc9b68d

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
@@ -5978,8 +5978,15 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
59785978
llvm::PrettyStackTraceString CrashInfo("Computing output path");
59795979
// Output to a user requested destination?
59805980
if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) {
5981-
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON))
5981+
Arg *FinalOutput =
5982+
IsCLMode()
5983+
? C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo,
5984+
options::OPT__SLASH_Fo_COLON)
5985+
: C.getArgs().getLastArg(options::OPT_o);
5986+
5987+
if (FinalOutput != nullptr) {
59825988
return C.addResultFile(FinalOutput->getValue(), &JA);
5989+
}
59835990
}
59845991

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

0 commit comments

Comments
 (0)