@@ -1936,7 +1936,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
1936
1936
return ;
1937
1937
}
1938
1938
1939
- SmallVector< const Action *, 2 > AllModuleInputs;
1939
+ ModuleInputs AllModuleInputs;
1940
1940
SmallVector<const Action *, 2 > AllLinkerInputs;
1941
1941
1942
1942
switch (OI.CompilerMode ) {
@@ -1977,18 +1977,16 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
1977
1977
// Source inputs always need to be compiled.
1978
1978
assert (file_types::isPartOfSwiftCompilation (InputType));
1979
1979
1980
- CompileJobAction::InputInfo previousBuildState = {
1981
- CompileJobAction::InputInfo::NeedsCascadingBuild,
1982
- llvm::sys::TimePoint<>::min ()
1983
- };
1980
+ auto previousBuildState =
1981
+ IncrementalJobAction::InputInfo::makeNeedsCascadingRebuild ();
1984
1982
if (OutOfDateMap)
1985
1983
previousBuildState = OutOfDateMap->lookup (InputArg);
1986
1984
if (Args.hasArg (options::OPT_embed_bitcode)) {
1987
1985
Current = C.createAction <CompileJobAction>(
1988
1986
Current, file_types::TY_LLVM_BC, previousBuildState);
1989
1987
if (PCH)
1990
1988
cast<JobAction>(Current)->addInput (PCH);
1991
- AllModuleInputs.push_back (Current);
1989
+ AllModuleInputs.addInput (Current);
1992
1990
Current = C.createAction <BackendJobAction>(Current,
1993
1991
OI.CompilerOutputType , 0 );
1994
1992
} else {
@@ -1997,7 +1995,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
1997
1995
previousBuildState);
1998
1996
if (PCH)
1999
1997
cast<JobAction>(Current)->addInput (PCH);
2000
- AllModuleInputs.push_back (Current);
1998
+ AllModuleInputs.addInput (Current);
2001
1999
}
2002
2000
AllLinkerInputs.push_back (Current);
2003
2001
break ;
@@ -2009,7 +2007,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2009
2007
// When generating a .swiftmodule as a top-level output (as opposed
2010
2008
// to, for example, linking an image), treat .swiftmodule files as
2011
2009
// inputs to a MergeModule action.
2012
- AllModuleInputs.push_back (Current);
2010
+ AllModuleInputs.addInput (Current);
2013
2011
break ;
2014
2012
} else if (OI.shouldLink ()) {
2015
2013
// Otherwise, if linking, pass .swiftmodule files as inputs to the
@@ -2091,7 +2089,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2091
2089
// Create a single CompileJobAction and a single BackendJobAction.
2092
2090
JobAction *CA =
2093
2091
C.createAction <CompileJobAction>(file_types::TY_LLVM_BC);
2094
- AllModuleInputs.push_back (CA);
2092
+ AllModuleInputs.addInput (CA);
2095
2093
2096
2094
int InputIndex = 0 ;
2097
2095
for (const InputPair &Input : Inputs) {
@@ -2127,7 +2125,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2127
2125
2128
2126
CA->addInput (C.createAction <InputAction>(*InputArg, InputType));
2129
2127
}
2130
- AllModuleInputs.push_back (CA);
2128
+ AllModuleInputs.addInput (CA);
2131
2129
AllLinkerInputs.push_back (CA);
2132
2130
break ;
2133
2131
}
@@ -2176,7 +2174,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2176
2174
!AllModuleInputs.empty ()) {
2177
2175
// We're performing multiple compilations; set up a merge module step
2178
2176
// so we generate a single swiftmodule as output.
2179
- MergeModuleAction = C. createAction <MergeModuleJobAction> (AllModuleInputs);
2177
+ MergeModuleAction = std::move (AllModuleInputs). intoAction (C );
2180
2178
}
2181
2179
2182
2180
bool shouldPerformLTO = OI.LTOVariant != OutputInfo::LTOKind::None;
0 commit comments