FrontendInputs data structure redo.

- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
This commit is contained in:
David Ungar
2017-12-03 14:39:01 -08:00
parent 2cda5a91c5
commit 28b206008f
30 changed files with 585 additions and 591 deletions

View File

@@ -135,7 +135,7 @@ SourceFile *getSourceFile(CompilerInstance &Instance,
const char *MainExecutablePath) {
CompilerInvocation Invocation;
Invocation.getLangOptions().KeepSyntaxInfoInSourceFile = true;
Invocation.addInputFilename(InputFileName);
Invocation.getFrontendOptions().Inputs.addInputFile(InputFileName);
Invocation.setMainExecutablePath(
llvm::sys::fs::getMainExecutable(MainExecutablePath,
reinterpret_cast<void *>(&anchorForGetMainExecutable)));