[clang] b105f35 - [clang][bytecode][NFC] Unify "this pointer" naming in interp::Function (#207410)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 4 07:52:57 PDT 2026
Author: Timm Baeder
Date: 2026-07-04T16:52:53+02:00
New Revision: b105f35c2d0befe65545092894a2a2d292192582
URL: https://github.com/llvm/llvm-project/commit/b105f35c2d0befe65545092894a2a2d292192582
DIFF: https://github.com/llvm/llvm-project/commit/b105f35c2d0befe65545092894a2a2d292192582.diff
LOG: [clang][bytecode][NFC] Unify "this pointer" naming in interp::Function (#207410)
Added:
Modified:
clang/lib/AST/ByteCode/Compiler.cpp
clang/lib/AST/ByteCode/Function.h
clang/lib/AST/ByteCode/Interp.cpp
Removed:
################################################################################
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 b099a3e8571f7..4a7259b91a7f9 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -256,7 +256,7 @@ void cleanupAfterFunctionCall(InterpState &S, const Function *Func) {
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>();
@@ -2331,7 +2331,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())
More information about the cfe-commits
mailing list