mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cxx-interop] Use the locations imported from C++
A recent PR (#77204) started to import C++ source locations into Swift. This PR flips a switch so these locations are actually used more widely. Now some of the diagnostic locations are changed, but they generally improved the quality of the diagnostics, pointing out conformances imported from Obj-C code right when they are declared.
This commit is contained in:
@@ -1011,6 +1011,7 @@ static_assert(sizeof(checkSourceLocType(&ID##Decl::getLoc)) == 2, \
|
||||
return getLocFromSource();
|
||||
switch(File->getKind()) {
|
||||
case FileUnitKind::Source:
|
||||
case FileUnitKind::ClangModule:
|
||||
return getLocFromSource();
|
||||
case FileUnitKind::SerializedAST: {
|
||||
if (!SerializedOK)
|
||||
@@ -1019,7 +1020,6 @@ static_assert(sizeof(checkSourceLocType(&ID##Decl::getLoc)) == 2, \
|
||||
}
|
||||
case FileUnitKind::Builtin:
|
||||
case FileUnitKind::Synthesized:
|
||||
case FileUnitKind::ClangModule:
|
||||
case FileUnitKind::DWARFModule:
|
||||
return SourceLoc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user