@@ -305,15 +305,15 @@ static SmallVector<unsigned, 1> getSourceBufferStack(
305
305
}
306
306
307
307
void *PrintingDiagnosticConsumer::getSourceFileSyntax (
308
- SourceManager &sourceMgr, unsigned bufferID) {
308
+ SourceManager &sourceMgr, unsigned bufferID, StringRef displayName ) {
309
309
auto known = sourceFileSyntax.find ({&sourceMgr, bufferID});
310
310
if (known != sourceFileSyntax.end ())
311
311
return known->second ;
312
312
313
313
auto bufferContents = sourceMgr.getEntireTextForBuffer (bufferID);
314
314
auto sourceFile = swift_ASTGen_parseSourceFile (
315
315
bufferContents.data (), bufferContents.size (),
316
- " module" , " file.swift " , /* ctx*/ nullptr );
316
+ " module" , displayName. str (). c_str () , /* ctx*/ nullptr );
317
317
318
318
sourceFileSyntax[{&sourceMgr, bufferID}] = sourceFile;
319
319
return sourceFile;
@@ -355,7 +355,7 @@ void PrintingDiagnosticConsumer::queueBuffer(
355
355
sourceMgr.getLocForBufferStart (bufferID)).str ();
356
356
}
357
357
358
- auto sourceFile = getSourceFileSyntax (sourceMgr, bufferID);
358
+ auto sourceFile = getSourceFileSyntax (sourceMgr, bufferID, displayName );
359
359
swift_ASTGen_addQueuedSourceFile (
360
360
queuedDiagnostics, bufferID, sourceFile,
361
361
(const uint8_t *)displayName.data (), displayName.size (),
0 commit comments