================
@@ -186,14 +186,14 @@ class CrossTranslationUnitContext {
/// Emit diagnostics for the user for potential configuration errors.
void emitCrossTUDiagnostics(const IndexError &IE);
- /// Returns the MacroExpansionContext for the imported TU to which the given
- /// source-location corresponds.
- /// \p ToLoc Source location in the imported-to AST.
- /// \note If any error happens such as \p ToLoc is a non-imported
+ /// Returns the MacroExpansionContext for the imported TU and the location in
+ /// the imported-from AST to which the given source-location corresponds. \p
+ /// ToLoc Source location in the imported-to AST. \note If any error happens
+ /// such as \p ToLoc is a non-imported
/// source-location, empty is returned.
/// \note Macro expansion tracking for imported TUs is not implemented yet.
/// It returns empty unconditionally.
- std::optional<clang::MacroExpansionContext>
+ std::optional<std::pair<MacroExpansionContext, SourceLocation>>
----------------
vvuksanovic wrote:
It now also returns the corresponding `SourceLocation` in the 'imported from'
context. The `MacroExpansionContext` for each TU contains locations in its
original context, but this function receives 'imported to' `SourceLocation`s.
The getters in `MacroExpansionContext` also expect to receive locations in the
'imported from' context, so they have to be translated somewhere.
I am not sure how this API was intended to be used
https://github.com/llvm/llvm-project/pull/176126
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits