Address Jordan’s comments:

- Also be consistent about has vs have for Input predicates

Fix bug.
This commit is contained in:
David Ungar
2017-11-18 11:55:58 -08:00
parent 07dfa263cd
commit 26537ea26c
9 changed files with 76 additions and 83 deletions

View File

@@ -542,7 +542,7 @@ static bool performCompile(CompilerInstance &Instance,
auto &LLVMContext = getGlobalLLVMContext();
// Load in bitcode file.
assert(Invocation.getFrontendOptions().Inputs.hasUniqueInputFilename() &&
assert(Invocation.getFrontendOptions().Inputs.haveUniqueInputFilename() &&
"We expect a single input for bitcode input!");
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =
llvm::MemoryBuffer::getFileOrSTDIN(
@@ -780,7 +780,7 @@ static bool performCompile(CompilerInstance &Instance,
if (opts.Inputs.haveAPrimaryInputFile()) {
FileUnit *PrimaryFile = PrimarySourceFile;
if (!PrimaryFile) {
auto Index = opts.Inputs.getOptionalPrimaryInput()->Index;
auto Index = opts.Inputs.getRequiredUniquePrimaryInput().Index;
PrimaryFile = Instance.getMainModule()->getFiles()[Index];
}
astGuaranteedToCorrespondToSIL = !fileIsSIB(PrimaryFile);