@@ -305,15 +305,15 @@ static SmallVector<unsigned, 1> getSourceBufferStack(
305305}
306306
307307void *PrintingDiagnosticConsumer::getSourceFileSyntax (
308- SourceManager &sourceMgr, unsigned bufferID) {
308+ SourceManager &sourceMgr, unsigned bufferID, StringRef displayName ) {
309309 auto known = sourceFileSyntax.find ({&sourceMgr, bufferID});
310310 if (known != sourceFileSyntax.end ())
311311 return known->second ;
312312
313313 auto bufferContents = sourceMgr.getEntireTextForBuffer (bufferID);
314314 auto sourceFile = swift_ASTGen_parseSourceFile (
315315 bufferContents.data (), bufferContents.size (),
316- " module" , " file.swift " , /* ctx*/ nullptr );
316+ " module" , displayName. str (). c_str () , /* ctx*/ nullptr );
317317
318318 sourceFileSyntax[{&sourceMgr, bufferID}] = sourceFile;
319319 return sourceFile;
@@ -355,7 +355,7 @@ void PrintingDiagnosticConsumer::queueBuffer(
355355 sourceMgr.getLocForBufferStart (bufferID)).str ();
356356 }
357357
358- auto sourceFile = getSourceFileSyntax (sourceMgr, bufferID);
358+ auto sourceFile = getSourceFileSyntax (sourceMgr, bufferID, displayName );
359359 swift_ASTGen_addQueuedSourceFile (
360360 queuedDiagnostics, bufferID, sourceFile,
361361 (const uint8_t *)displayName.data (), displayName.size (),
0 commit comments