mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Diagnostics only work with `SourceLoc` which is basically a pointer into a buffer of the loaded source file. But when debug info is de-serialized, the SIL `Location` consists of a filename+line+column. To "convert" this to a `SourceLoc`, the file must be loaded. This change adds `DiagnosticEngine.getLocationFromExternalSource` for this purpose. Also, the new protocol `ProvidingSourceLocation` - to which `SourceLoc` and `Location` conform - help to generalize the helper struct `Diagnostic` and make this "conversion" happen automatically.
14 KiB
14 KiB