[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:
Gabor Horvath
2024-10-31 15:59:00 +00:00
parent 09c89fb983
commit 6d24c52b80
13 changed files with 33 additions and 36 deletions

View File

@@ -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();
}