[clang] 70e61f5 - [clang][Interp][NFC] Rename InitPtr{,Pop} to FinishInit{,Pop}
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 27 07:14:50 PST 2024
Author: Timm Bäder
Date: 2024-02-27T16:14:37+01:00
New Revision: 70e61f5bbbb0958bebedffb1be285fdefb0e2f0a
URL: https://github.com/llvm/llvm-project/commit/70e61f5bbbb0958bebedffb1be285fdefb0e2f0a
DIFF: https://github.com/llvm/llvm-project/commit/70e61f5bbbb0958bebedffb1be285fdefb0e2f0a.diff
LOG: [clang][Interp][NFC] Rename InitPtr{,Pop} to FinishInit{,Pop}
The old name clashes with the Init opcode.
Added:
Modified:
clang/lib/AST/Interp/ByteCodeExprGen.cpp
clang/lib/AST/Interp/ByteCodeExprGen.h
clang/lib/AST/Interp/ByteCodeStmtGen.cpp
clang/lib/AST/Interp/Interp.h
clang/lib/AST/Interp/Opcodes.td
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index a71b6e82817e4a..b3a7bc587b647a 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -897,7 +897,7 @@ bool ByteCodeExprGen<Emitter>::visitInitList(ArrayRef<const Expr *> Inits,
if (!this->visitInitializer(Init))
return false;
- if (!this->emitInitPtrPop(E))
+ if (!this->emitFinishInitPop(E))
return false;
// Base initializers don't increase InitIndex, since they don't count
// into the Record's fields.
@@ -940,7 +940,7 @@ bool ByteCodeExprGen<Emitter>::visitArrayElemInit(unsigned ElemIndex,
return false;
if (!this->visitInitializer(Init))
return false;
- return this->emitInitPtrPop(Init);
+ return this->emitFinishInitPop(Init);
}
template <class Emitter>
@@ -2151,7 +2151,7 @@ bool ByteCodeExprGen<Emitter>::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {
}
}
- return this->emitInitPtr(E);
+ return this->emitFinishInit(E);
}
template <class Emitter>
@@ -2364,7 +2364,7 @@ bool ByteCodeExprGen<Emitter>::visitZeroRecordInitializer(const Record *R,
return false;
if (!this->visitZeroRecordInitializer(B.R, E))
return false;
- if (!this->emitInitPtrPop(E))
+ if (!this->emitFinishInitPop(E))
return false;
}
@@ -2544,7 +2544,7 @@ bool ByteCodeExprGen<Emitter>::visitExpr(const Expr *E) {
if (!visitInitializer(E))
return false;
- if (!this->emitInitPtr(E))
+ if (!this->emitFinishInit(E))
return false;
return this->emitRetValue(E);
}
diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.h b/clang/lib/AST/Interp/ByteCodeExprGen.h
index 8f7a0c2fc3c103..8769d1d7b8502b 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.h
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.h
@@ -182,7 +182,7 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
if (!visitInitializer(Init))
return false;
- if (!this->emitInitPtr(Init))
+ if (!this->emitFinishInit(Init))
return false;
return this->emitPopPtr(Init);
@@ -196,7 +196,7 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
if (!visitInitializer(Init))
return false;
- if (!this->emitInitPtr(Init))
+ if (!this->emitFinishInit(Init))
return false;
return this->emitPopPtr(Init);
@@ -210,7 +210,7 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
if (!visitInitializer(I))
return false;
- return this->emitInitPtrPop(I);
+ return this->emitFinishInitPop(I);
}
bool visitInitList(ArrayRef<const Expr *> Inits, const Expr *E);
diff --git a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
index 7e2043f8de90b0..d9213b12cbd08b 100644
--- a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
@@ -200,7 +200,7 @@ bool ByteCodeStmtGen<Emitter>::visitFunc(const FunctionDecl *F) {
return false;
if (!this->visitInitializer(InitExpr))
return false;
- if (!this->emitInitPtrPop(InitExpr))
+ if (!this->emitFinishInitPop(InitExpr))
return false;
} else if (const IndirectFieldDecl *IFD = Init->getIndirectMember()) {
assert(IFD->getChainingSize() >= 2);
diff --git a/clang/lib/AST/Interp/Interp.h b/clang/lib/AST/Interp/Interp.h
index 2b36a05e1af96a..caddcb5f978037 100644
--- a/clang/lib/AST/Interp/Interp.h
+++ b/clang/lib/AST/Interp/Interp.h
@@ -1280,14 +1280,14 @@ inline bool GetPtrThisBase(InterpState &S, CodePtr OpPC, uint32_t Off) {
return true;
}
-inline bool InitPtrPop(InterpState &S, CodePtr OpPC) {
+inline bool FinishInitPop(InterpState &S, CodePtr OpPC) {
const Pointer &Ptr = S.Stk.pop<Pointer>();
if (Ptr.canBeInitialized())
Ptr.initialize();
return true;
}
-inline bool InitPtr(InterpState &S, CodePtr OpPC) {
+inline bool FinishInit(InterpState &S, CodePtr OpPC) {
const Pointer &Ptr = S.Stk.peek<Pointer>();
if (Ptr.canBeInitialized())
diff --git a/clang/lib/AST/Interp/Opcodes.td b/clang/lib/AST/Interp/Opcodes.td
index e36c42d450fc9f..3f71087ebee567 100644
--- a/clang/lib/AST/Interp/Opcodes.td
+++ b/clang/lib/AST/Interp/Opcodes.td
@@ -326,8 +326,8 @@ def GetPtrBasePop : Opcode {
let Args = [ArgUint32];
}
-def InitPtrPop : Opcode;
-def InitPtr : Opcode;
+def FinishInitPop : Opcode;
+def FinishInit : Opcode;
def GetPtrDerivedPop : Opcode {
let Args = [ArgUint32];
More information about the cfe-commits
mailing list