llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/207410.diff


3 Files Affected:

- (modified) clang/lib/AST/ByteCode/Compiler.cpp (+2-2) 
- (modified) clang/lib/AST/ByteCode/Function.h (+5-3) 
- (modified) clang/lib/AST/ByteCode/Interp.cpp (+2-2) 


``````````diff
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..18291144fdc21 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -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())

``````````

</details>


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

Reply via email to