@@ -1697,8 +1697,10 @@ namespace driver {
1697
1697
if (ResultCode == 0 )
1698
1698
ResultCode = Comp.getDiags ().hadAnyError ();
1699
1699
const bool forRanges = Comp.getEnableSourceRangeDependencies ();
1700
- return Compilation::Result{
1701
- ResultCode, std::move (*this ).takeFineGrainedDepGraph (forRanges)};
1700
+ const bool hadAbnormalExit = hadAnyAbnormalExit ();
1701
+ const auto resultCode = ResultCode;
1702
+ auto &&graph = std::move (*this ).takeFineGrainedDepGraph (forRanges);
1703
+ return Compilation::Result{hadAbnormalExit, resultCode, std::move (graph)};
1702
1704
}
1703
1705
1704
1706
bool hadAnyAbnormalExit () {
@@ -1970,23 +1972,23 @@ Compilation::Result Compilation::performSingleCommand(const Job *Cmd) {
1970
1972
1971
1973
switch (Cmd->getCondition ()) {
1972
1974
case Job::Condition::CheckDependencies:
1973
- return Compilation::Result{ 0 , fine_grained_dependencies::ModuleDepGraph ()} ;
1975
+ return Compilation::Result::code ( 0 ) ;
1974
1976
case Job::Condition::RunWithoutCascading:
1975
1977
case Job::Condition::Always:
1976
1978
case Job::Condition::NewlyAdded:
1977
1979
break ;
1978
1980
}
1979
1981
1980
1982
if (!writeFilelistIfNecessary (Cmd, *TranslatedArgs.get (), Diags))
1981
- return Compilation::Result{ 1 , fine_grained_dependencies::ModuleDepGraph ()} ;
1983
+ return Compilation::Result::code ( 1 ) ;
1982
1984
1983
1985
switch (Level) {
1984
1986
case OutputLevel::Normal:
1985
1987
case OutputLevel::Parseable:
1986
1988
break ;
1987
1989
case OutputLevel::PrintJobs:
1988
1990
Cmd->printCommandLineAndEnvironment (llvm::outs ());
1989
- return Compilation::Result{ 0 , fine_grained_dependencies::ModuleDepGraph ()} ;
1991
+ return Compilation::Result::code ( 0 ) ;
1990
1992
case OutputLevel::Verbose:
1991
1993
Cmd->printCommandLine (llvm::errs ());
1992
1994
break ;
@@ -2010,14 +2012,12 @@ Compilation::Result Compilation::performSingleCommand(const Job *Cmd) {
2010
2012
" expected environment variable to be set successfully" );
2011
2013
// Bail out early in release builds.
2012
2014
if (envResult != 0 ) {
2013
- return Compilation::Result{envResult,
2014
- fine_grained_dependencies::ModuleDepGraph ()};
2015
+ return Compilation::Result::code (envResult);
2015
2016
}
2016
2017
}
2017
2018
2018
2019
const auto returnCode = ExecuteInPlace (ExecPath, argv);
2019
- return Compilation::Result{returnCode,
2020
- fine_grained_dependencies::ModuleDepGraph ()};
2020
+ return Compilation::Result::code (returnCode);
2021
2021
}
2022
2022
2023
2023
static bool writeAllSourcesFile (DiagnosticEngine &diags, StringRef path,
@@ -2043,8 +2043,7 @@ static bool writeAllSourcesFile(DiagnosticEngine &diags, StringRef path,
2043
2043
Compilation::Result Compilation::performJobs (std::unique_ptr<TaskQueue> &&TQ) {
2044
2044
if (AllSourceFilesPath)
2045
2045
if (!writeAllSourcesFile (Diags, AllSourceFilesPath, getInputFiles ()))
2046
- return Compilation::Result{EXIT_FAILURE,
2047
- fine_grained_dependencies::ModuleDepGraph ()};
2046
+ return Compilation::Result::code (EXIT_FAILURE);
2048
2047
2049
2048
// If we don't have to do any cleanup work, just exec the subprocess.
2050
2049
if (Level < OutputLevel::Parseable &&
0 commit comments