[clang] [clang][bytecode] Remove split frame business (PR #155980)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 29 00:09:41 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
This was never really needed.
---
Full diff: https://github.com/llvm/llvm-project/pull/155980.diff
4 Files Affected:
- (modified) clang/lib/AST/ByteCode/InterpFrame.cpp (-6)
- (modified) clang/lib/AST/ByteCode/InterpFrame.h (+1-1)
- (modified) clang/lib/AST/ByteCode/InterpState.cpp (+1-5)
- (modified) clang/lib/AST/ByteCode/InterpState.h (+1-4)
``````````diff
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 {
``````````
</details>
https://github.com/llvm/llvm-project/pull/155980
More information about the cfe-commits
mailing list