mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Frontend] For CompilerInstance::performParseOnly() make sure to mark the main buffer so a hashbang is accepted.
Test case on the SourceKit side. rdar://17282145 Swift SVN r19320
This commit is contained in:
@@ -436,6 +436,9 @@ void CompilerInstance::performParseOnly() {
|
||||
assert(Kind == SourceFileKind::Main || Kind == SourceFileKind::Library);
|
||||
assert(BufferIDs.size() == 1 && "only supports parsing a single file");
|
||||
|
||||
if (Kind == SourceFileKind::Main)
|
||||
SourceMgr.setHashbangBufferID(BufferIDs[0]);
|
||||
|
||||
auto *Input = new (*Context) SourceFile(*MainModule,
|
||||
Kind,
|
||||
BufferIDs[0],
|
||||
|
||||
Reference in New Issue
Block a user