[clang] [clang] Remove source range from CXXOperatorCallExpr (PR #147028)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 4 07:37:24 PDT 2025
================
@@ -158,9 +158,9 @@ class CXXOperatorCallExpr final : public CallExpr {
: getOperatorLoc();
}
- SourceLocation getBeginLoc() const { return Range.getBegin(); }
- SourceLocation getEndLoc() const { return Range.getEnd(); }
- SourceRange getSourceRange() const { return Range; }
+ SourceLocation getBeginLoc() const { return BeginLoc; }
+ SourceLocation getEndLoc() const { return getSourceRangeImpl().getEnd(); }
----------------
cor3ntin wrote:
I think we could simplify getEndLoc() to be a trimmed-down version of getSourceRangeImpl
* for OO_Call/ OO_Subscript => `getRParenLoc()`
* for 1 argument = > `getArg(0)->getEndLoc()`
* for OO_PlusPlus/OO_MinusMinus => `getOperatorLoc()`
* for 2 argument: `getArg(1)->getEndLoc()`
I am not sure about the current handling of `OO_Arrow` in `getSourceRangeImpl`
https://github.com/llvm/llvm-project/pull/147028
More information about the cfe-commits
mailing list