[clang] a805dfb - [clang][bytecode] Remove split frame business (#155980)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 29 00:42:50 PDT 2025
Author: Timm Baeder
Date: 2025-08-29T09:42:46+02:00
New Revision: a805dfbc9f8fd7970b1376b1b9362ce1320fc04c
URL: https://github.com/llvm/llvm-project/commit/a805dfbc9f8fd7970b1376b1b9362ce1320fc04c
DIFF: https://github.com/llvm/llvm-project/commit/a805dfbc9f8fd7970b1376b1b9362ce1320fc04c.diff
LOG: [clang][bytecode] Remove split frame business (#155980)
This was never really needed.
Added:
Modified:
clang/lib/AST/ByteCode/InterpFrame.cpp
clang/lib/AST/ByteCode/InterpFrame.h
clang/lib/AST/ByteCode/InterpState.cpp
clang/lib/AST/ByteCode/InterpState.h
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/InterpFrame.cpp b/clang/lib/AST/ByteCode/InterpFrame.cpp
index 18400b10c47b0..b9dc2aed23113 100644
--- a/clang/lib/AST/ByteCode/InterpFrame.cpp
+++ b/clang/lib/AST/ByteCode/InterpFrame.cpp
@@ -195,12 +195,6 @@ void InterpFrame::describe(llvm::raw_ostream &OS) const {
OS << ")";
}
-Frame *InterpFrame::getCaller() const {
- if (Caller->Caller)
- return Caller;
- return S.getSplitFrame();
-}
-
SourceRange InterpFrame::getCallRange() const {
if (!Caller->Func) {
if (SourceRange NullRange = S.getRange(nullptr, {}); NullRange.isValid())
diff --git a/clang/lib/AST/ByteCode/InterpFrame.h b/clang/lib/AST/ByteCode/InterpFrame.h
index 4be53911b615e..cf4d27d341e91 100644
--- a/clang/lib/AST/ByteCode/InterpFrame.h
+++ b/clang/lib/AST/ByteCode/InterpFrame.h
@@ -59,7 +59,7 @@ class InterpFrame final : public Frame {
void describe(llvm::raw_ostream &OS) const override;
/// Returns the parent frame object.
- Frame *getCaller() const override;
+ Frame *getCaller() const override { return Caller; }
/// Returns the location of the call to the frame.
SourceRange getCallRange() const override;
diff --git a/clang/lib/AST/ByteCode/InterpState.cpp b/clang/lib/AST/ByteCode/InterpState.cpp
index f89967759ff9b..a2a1e5826d7c5 100644
--- a/clang/lib/AST/ByteCode/InterpState.cpp
+++ b/clang/lib/AST/ByteCode/InterpState.cpp
@@ -62,11 +62,7 @@ void InterpState::cleanup() {
Alloc.cleanup();
}
-Frame *InterpState::getCurrentFrame() {
- if (Current && Current->Caller)
- return Current;
- return Parent.getCurrentFrame();
-}
+Frame *InterpState::getCurrentFrame() { return Current; }
bool InterpState::reportOverflow(const Expr *E, const llvm::APSInt &Value) {
QualType Type = E->getType();
diff --git a/clang/lib/AST/ByteCode/InterpState.h b/clang/lib/AST/ByteCode/InterpState.h
index 861e4c38049ab..f123a1f169c02 100644
--- a/clang/lib/AST/ByteCode/InterpState.h
+++ b/clang/lib/AST/ByteCode/InterpState.h
@@ -57,14 +57,11 @@ class InterpState final : public State, public SourceMapper {
bool diagnosing() const { return getEvalStatus().Diag != nullptr; }
// Stack frame accessors.
- Frame *getSplitFrame() { return Parent.getCurrentFrame(); }
Frame *getCurrentFrame() override;
unsigned getCallStackDepth() override {
return Current ? (Current->getDepth() + 1) : 1;
}
- const Frame *getBottomFrame() const override {
- return Parent.getBottomFrame();
- }
+ const Frame *getBottomFrame() const override { return &BottomFrame; }
// Access objects from the walker context.
Expr::EvalStatus &getEvalStatus() const override {
More information about the cfe-commits
mailing list