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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 06:46:39 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();
----------------
erichkeane wrote:

I find myself curious why we go back and forth to raw-encoding?  I thought that is supposed to only happen when we are in a situation where SourceLocation isn't really visible, but it should be here, right?

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


More information about the cfe-commits mailing list