mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Maintain a buffer ID -> source file(s) mapping in the source manager
Now that every source file has a buffer ID, introduce the reverse mapping so clients can find the source file(s) in their module that reference that buffer ID.
This commit is contained in:
@@ -3446,6 +3446,8 @@ SourceFile::SourceFile(ModuleDecl &M, SourceFileKind K,
|
||||
(void)problem;
|
||||
}
|
||||
|
||||
M.getASTContext().SourceMgr.recordSourceFile(bufferID, this);
|
||||
|
||||
if (Kind == SourceFileKind::MacroExpansion ||
|
||||
Kind == SourceFileKind::DefaultArgument)
|
||||
M.addAuxiliaryFile(*this);
|
||||
|
||||
Reference in New Issue
Block a user