Merge pull request #82171 from j-hui/j-hui/6.2/jump-to-def-for-macro-expanded-clang-imports

🍒 [6.2] [SourceKit] Support location info for macro-expanded Clang imports
This commit is contained in:
John Hui
2025-06-13 04:10:37 -07:00
committed by GitHub
10 changed files with 225 additions and 124 deletions

View File

@@ -434,19 +434,6 @@ public:
/// \c nullptr if the source location isn't in this module.
SourceFile *getSourceFileContainingLocation(SourceLoc loc);
// Retrieve the buffer ID and source range of the outermost node that
// caused the generation of the buffer containing \p range. \p range and its
// buffer if it isn't in a generated buffer or has no original range.
std::pair<unsigned, SourceRange> getOriginalRange(SourceRange range) const;
// Retrieve the buffer ID and source location of the outermost location that
// caused the generation of the buffer containing \p loc. \p loc and its
// buffer if it isn't in a generated buffer or has no original location.
std::pair<unsigned, SourceLoc> getOriginalLocation(SourceLoc loc) const {
auto [buffer, range] = getOriginalRange(loc);
return std::make_pair(buffer, range.Start);
}
/// Creates a map from \c #filePath strings to corresponding \c #fileID
/// strings, diagnosing any conflicts.
///