[frontend] Input buffers have names too

There's no need to skip filename checks for in-memory buffers, and
indeed we want sourcekitd to behave the same for main.swift files as the
compiler.

SR-6624
rdar://36113282
This commit is contained in:
Ben Langmuir
2018-02-27 12:01:29 -08:00
parent 3992a8c94f
commit ce1cfcc73d
4 changed files with 13 additions and 1 deletions

View File

@@ -233,7 +233,7 @@ bool CompilerInstance::setUpForInput(const InputFile &input) {
return false;
if (isInSILMode() ||
(input.buffer() == nullptr && isInputSwift() &&
(isInputSwift() &&
llvm::sys::path::filename(input.file()) == "main.swift")) {
assert(MainBufferID == NO_SUCH_BUFFER && "re-setting MainBufferID");
MainBufferID = *bufferID;