https://github.com/tbaederr updated 
https://github.com/llvm/llvm-project/pull/207410

>From 090aa0d67167206bb830c334340381a1a38d0e5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]>
Date: Fri, 3 Jul 2026 16:51:50 +0200
Subject: [PATCH] [clang][bytecode][NFC] Unify "this pointer" naming in
 interp::Function

---
 clang/lib/AST/ByteCode/Compiler.cpp | 4 ++--
 clang/lib/AST/ByteCode/Function.h   | 8 +++++---
 clang/lib/AST/ByteCode/Interp.cpp   | 6 +++---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index 2458860f44eb5..090bbf4596413 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -6006,7 +6006,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
       uint32_t VarArgSize = 0;
       unsigned NumParams =
           Func->getNumWrittenParams() +
-          (isa<CXXOperatorCallExpr>(E) && Func->hasImplicitThisParam());
+          (isa<CXXOperatorCallExpr>(E) && Func->hasImplicitThisPointer());
       for (unsigned I = NumParams, N = E->getNumArgs(); I != N; ++I)
         VarArgSize += align(primSize(classify(E->getArg(I)).value_or(PT_Ptr)));
 
@@ -6016,7 +6016,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
       uint32_t VarArgSize = 0;
       unsigned NumParams =
           Func->getNumWrittenParams() +
-          (isa<CXXOperatorCallExpr>(E) && Func->hasImplicitThisParam());
+          (isa<CXXOperatorCallExpr>(E) && Func->hasImplicitThisPointer());
       for (unsigned I = NumParams, N = E->getNumArgs(); I != N; ++I)
         VarArgSize += align(primSize(classify(E->getArg(I)).value_or(PT_Ptr)));
       if (!this->emitCallVar(Func, VarArgSize, E))
diff --git a/clang/lib/AST/ByteCode/Function.h 
b/clang/lib/AST/ByteCode/Function.h
index 289bd64124004..27edfc6d08916 100644
--- a/clang/lib/AST/ByteCode/Function.h
+++ b/clang/lib/AST/ByteCode/Function.h
@@ -224,9 +224,11 @@ class Function final {
   bool isFullyCompiled() const { return IsFullyCompiled; }
 
   bool hasThisPointer() const { return HasThisPointer; }
-  bool isThisPointerExplicit() const { return ExplicitThisPointer; }
-  bool hasImplicitThisParam() const {
-    return hasThisPointer() && !ExplicitThisPointer;
+  bool hasExplicitThisPointer() const {
+    return HasThisPointer && ExplicitThisPointer;
+  }
+  bool hasImplicitThisPointer() const {
+    return HasThisPointer && !ExplicitThisPointer;
   }
 
   /// Checks if the function already has a body attached.
diff --git a/clang/lib/AST/ByteCode/Interp.cpp 
b/clang/lib/AST/ByteCode/Interp.cpp
index 4815828adb613..2d592094ab1c9 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -267,7 +267,7 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC,
     assert(NumArgs >= Func->getNumWrittenParams());
     NumVarArgs = NumArgs - (Func->getNumWrittenParams() +
                             (isa<CXXOperatorCallExpr>(CallSite) &&
-                             Func->hasImplicitThisParam()));
+                             Func->hasImplicitThisPointer()));
     for (unsigned I = 0; I != NumVarArgs; ++I) {
       const Expr *A = Args[NumArgs - 1 - I];
       popArg(S, A);
@@ -279,7 +279,7 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC,
   for (const Function::ParamDescriptor &PDesc : Func->args_reverse())
     TYPE_SWITCH(PDesc.T, S.Stk.discard<T>());
 
-  if (Func->hasThisPointer() && !Func->isThisPointerExplicit())
+  if (Func->hasImplicitThisPointer())
     S.Stk.discard<Pointer>();
   if (Func->hasRVO())
     S.Stk.discard<Pointer>();
@@ -2354,7 +2354,7 @@ bool CallPtr(InterpState &S, CodePtr OpPC, uint32_t 
ArgSize,
 
   // We need to do this explicitly here since we don't have the necessary
   // information to do it automatically.
-  if (F->isThisPointerExplicit())
+  if (F->hasExplicitThisPointer())
     VarArgSize -= align(primSize(PT_Ptr));
 
   if (F->isVirtual())

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to