Skip to content

Commit ff22639

Browse files
committed
Account for /Yc when generating PCH
1 parent fe69cf4 commit ff22639

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6099,12 +6099,10 @@ 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-
Arg *FinalOutput =
6103-
// CL and not generating a PCH: test for Fo, Fp, and Yc
6104-
IsCLMode() && !(C.getArgs().hasArg(options::OPT__SLASH_Yc) &&
6105-
C.getArgs().hasArg(options::OPT__SLASH_Fp))
6106-
? C.getArgs().getLastArg(options::OPT_o, options::OPT__SLASH_Fo,
6107-
options::OPT__SLASH_Fo_COLON)
6102+
// CL and not building a PCH. Not sure why the GNU-style driver doesn't need this.
6103+
// May need to rethink.
6104+
Arg *FinalOutput = IsCLMode() && !C.getArgs().hasArg(options::OPT__SLASH_Yc)
6105+
? C.getArgs().getLastArg(options::OPT__SLASH_Fo, options::OPT__SLASH_Fo_COLON)
61086106
: C.getArgs().getLastArg(options::OPT_o);
61096107

61106108
if (FinalOutput != nullptr) {

0 commit comments

Comments
 (0)