mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Pass around arguments for primary-specific filenames.
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "swift/Frontend/FrontendInputsAndOutputs.h"
|
||||
|
||||
#include "swift/AST/DiagnosticsFrontend.h"
|
||||
#include "swift/Basic/PrimarySpecificPaths.h"
|
||||
#include "swift/Frontend/FrontendOptions.h"
|
||||
#include "swift/Option/Options.h"
|
||||
#include "swift/Parse/Lexer.h"
|
||||
@@ -36,6 +37,8 @@ FrontendInputsAndOutputs::FrontendInputsAndOutputs(
|
||||
addInput(input);
|
||||
IsSingleThreadedWMO = other.IsSingleThreadedWMO;
|
||||
SupplementaryOutputs = other.SupplementaryOutputs;
|
||||
PrimarySpecificPathsForAtMostOnePrimary =
|
||||
other.PrimarySpecificPathsForAtMostOnePrimary;
|
||||
}
|
||||
|
||||
FrontendInputsAndOutputs &FrontendInputsAndOutputs::
|
||||
@@ -45,6 +48,8 @@ operator=(const FrontendInputsAndOutputs &other) {
|
||||
addInput(input);
|
||||
IsSingleThreadedWMO = other.IsSingleThreadedWMO;
|
||||
SupplementaryOutputs = other.SupplementaryOutputs;
|
||||
PrimarySpecificPathsForAtMostOnePrimary =
|
||||
other.PrimarySpecificPathsForAtMostOnePrimary;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -303,6 +308,18 @@ void FrontendInputsAndOutputs::setMainAndSupplementaryOutputs(
|
||||
AllInputs[i].setOutputFilename(outputFiles[i]);
|
||||
}
|
||||
SupplementaryOutputs = supplementaryOutputs;
|
||||
|
||||
if (hasInputs() && primaryInputCount() < 2) {
|
||||
// When batch mode is fully implemented, each InputFile will own
|
||||
// a PrimarySpecificPaths.
|
||||
PrimarySpecificPathsForAtMostOnePrimary.OutputFilename =
|
||||
getSingleOutputFilename();
|
||||
PrimarySpecificPathsForAtMostOnePrimary.MainInputFilenameForDebugInfo =
|
||||
hasInputsProducingMainOutputs() ? firstInputProducingOutput().file()
|
||||
: StringRef();
|
||||
PrimarySpecificPathsForAtMostOnePrimary.SupplementaryOutputs =
|
||||
supplementaryOutputs;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> FrontendInputsAndOutputs::copyOutputFilenames() const {
|
||||
@@ -379,3 +396,14 @@ bool FrontendInputsAndOutputs::hasDependencyTrackerPath() const {
|
||||
return hasDependenciesPath() || hasReferenceDependenciesPath() ||
|
||||
hasLoadedModuleTracePath();
|
||||
}
|
||||
|
||||
PrimarySpecificPaths &
|
||||
FrontendInputsAndOutputs::getPrimarySpecificPathsForAtMostOnePrimary() {
|
||||
return PrimarySpecificPathsForAtMostOnePrimary;
|
||||
}
|
||||
|
||||
PrimarySpecificPaths &
|
||||
FrontendInputsAndOutputs::getPrimarySpecificPathsForPrimary(
|
||||
StringRef filename) {
|
||||
return getPrimarySpecificPathsForAtMostOnePrimary(); // just a stub for now
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user