Renaming FrontendInputs -> FrontendInputsAndOutputs

Fix comment in ArtsToFrontendOptionsConverter re getOutputFilenamesFromCommandLineOrFilelist
This commit is contained in:
David Ungar
2018-01-23 22:17:58 -08:00
committed by David Ungar
parent 02fcdf150d
commit a9819b6e60
23 changed files with 168 additions and 142 deletions

View File

@@ -140,7 +140,7 @@ static bool emitMakeDependencies(DiagnosticEngine &diags,
// First include all other files in the module. Make-style dependencies
// need to be conservative!
for (auto const &path :
reversePathSortedFilenames(opts.Inputs.getInputFilenames()))
reversePathSortedFilenames(opts.InputsAndOutputs.getInputFilenames()))
out << ' ' << escape(path);
// Then print dependencies we've picked up during compilation.
for (auto const &path :
@@ -548,14 +548,16 @@ static bool performCompile(CompilerInstance &Instance,
auto &PCHOutDir = ImporterOpts.PrecompiledHeaderOutputDir;
if (!PCHOutDir.empty()) {
ImporterOpts.BridgingHeader =
Invocation.getFrontendOptions().Inputs.getFilenameOfFirstInput();
Invocation.getFrontendOptions()
.InputsAndOutputs.getFilenameOfFirstInput();
// Create or validate a persistent PCH.
auto SwiftPCHHash = Invocation.getPCHHash();
auto PCH = clangImporter->getOrCreatePCH(ImporterOpts, SwiftPCHHash);
return !PCH.hasValue();
}
return clangImporter->emitBridgingPCH(
Invocation.getFrontendOptions().Inputs.getFilenameOfFirstInput(),
Invocation.getFrontendOptions()
.InputsAndOutputs.getFilenameOfFirstInput(),
opts.getSingleOutputFilename());
}
@@ -566,15 +568,17 @@ static bool performCompile(CompilerInstance &Instance,
auto &LLVMContext = getGlobalLLVMContext();
// Load in bitcode file.
assert(Invocation.getFrontendOptions().Inputs.hasSingleInput() &&
assert(Invocation.getFrontendOptions().InputsAndOutputs.hasSingleInput() &&
"We expect a single input for bitcode input!");
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =
llvm::MemoryBuffer::getFileOrSTDIN(
Invocation.getFrontendOptions().Inputs.getFilenameOfFirstInput());
Invocation.getFrontendOptions()
.InputsAndOutputs.getFilenameOfFirstInput());
if (!FileBufOrErr) {
Instance.getASTContext().Diags.diagnose(
SourceLoc(), diag::error_open_input_file,
Invocation.getFrontendOptions().Inputs.getFilenameOfFirstInput(),
Invocation.getFrontendOptions()
.InputsAndOutputs.getFilenameOfFirstInput(),
FileBufOrErr.getError().message());
return true;
}
@@ -589,7 +593,8 @@ static bool performCompile(CompilerInstance &Instance,
// if available.
Instance.getASTContext().Diags.diagnose(
SourceLoc(), diag::error_parse_input_file,
Invocation.getFrontendOptions().Inputs.getFilenameOfFirstInput(),
Invocation.getFrontendOptions()
.InputsAndOutputs.getFilenameOfFirstInput(),
Err.getMessage());
return true;
}
@@ -806,13 +811,13 @@ static bool performCompile(CompilerInstance &Instance,
auto SASTF = dyn_cast<SerializedASTFile>(File);
return SASTF && SASTF->isSIB();
};
if (opts.Inputs.hasPrimaryInputs()) {
if (opts.InputsAndOutputs.hasPrimaryInputs()) {
if (Instance.getPrimarySourceFiles().empty()) {
// If we have primary inputs but no primary _source files_, we might
// have a primary serialized input.
for (FileUnit *fileUnit : mod->getFiles()) {
if (auto SASTF = dyn_cast<SerializedASTFile>(fileUnit)) {
if (Invocation.getFrontendOptions().Inputs.isInputPrimary(
if (Invocation.getFrontendOptions().InputsAndOutputs.isInputPrimary(
InputFile::
convertBufferNameFromLLVM_getFileOrSTDIN_toSwiftConventions(
SASTF->getFilename()))) {
@@ -1472,7 +1477,8 @@ int swift::performFrontend(ArrayRef<const char *> Args,
auto &FEOpts = Invocation.getFrontendOptions();
auto &LangOpts = Invocation.getLangOptions();
auto &SILOpts = Invocation.getSILOptions();
StringRef InputName = FEOpts.Inputs.getNameOfUniquePrimaryInputFile();
StringRef InputName =
FEOpts.InputsAndOutputs.getNameOfUniquePrimaryInputFile();
StringRef OptType = silOptModeArgStr(SILOpts.OptMode);
StringRef OutFile = FEOpts.getSingleOutputFilename();
StringRef OutputType = llvm::sys::path::extension(OutFile);