[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 08:17:00 PDT 2025


================
@@ -742,8 +742,12 @@ class CXXBoolLiteralExpr : public Expr {
   SourceLocation getBeginLoc() const { return getLocation(); }
   SourceLocation getEndLoc() const { return getLocation(); }
 
-  SourceLocation getLocation() const { return CXXBoolLiteralExprBits.Loc; }
-  void setLocation(SourceLocation L) { CXXBoolLiteralExprBits.Loc = L; }
+  SourceLocation getLocation() const {
+    return SourceLocation::getFromRawEncoding(CXXBoolLiteralExprBits.Loc);
+  }
+  void setLocation(SourceLocation L) {
+    CXXBoolLiteralExprBits.Loc = L.getRawEncoding();
----------------
hokein wrote:

Good point, agree. I don't see a particular reason using the raw encoding here, I think we can use `SourceLocation`, will send out a separate cleanup patch.

https://github.com/llvm/llvm-project/pull/146314


More information about the cfe-commits mailing list