Skip to content

Commit a805dfb

Browse files
authored
[clang][bytecode] Remove split frame business (#155980)
This was never really needed.
1 parent 71429f3 commit a805dfb

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

clang/lib/AST/ByteCode/InterpFrame.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,6 @@ void InterpFrame::describe(llvm::raw_ostream &OS) const {
195195
OS << ")";
196196
}
197197

198-
Frame *InterpFrame::getCaller() const {
199-
if (Caller->Caller)
200-
return Caller;
201-
return S.getSplitFrame();
202-
}
203-
204198
SourceRange InterpFrame::getCallRange() const {
205199
if (!Caller->Func) {
206200
if (SourceRange NullRange = S.getRange(nullptr, {}); NullRange.isValid())

clang/lib/AST/ByteCode/InterpFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class InterpFrame final : public Frame {
5959
void describe(llvm::raw_ostream &OS) const override;
6060

6161
/// Returns the parent frame object.
62-
Frame *getCaller() const override;
62+
Frame *getCaller() const override { return Caller; }
6363

6464
/// Returns the location of the call to the frame.
6565
SourceRange getCallRange() const override;

clang/lib/AST/ByteCode/InterpState.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ void InterpState::cleanup() {
6262
Alloc.cleanup();
6363
}
6464

65-
Frame *InterpState::getCurrentFrame() {
66-
if (Current && Current->Caller)
67-
return Current;
68-
return Parent.getCurrentFrame();
69-
}
65+
Frame *InterpState::getCurrentFrame() { return Current; }
7066

7167
bool InterpState::reportOverflow(const Expr *E, const llvm::APSInt &Value) {
7268
QualType Type = E->getType();

clang/lib/AST/ByteCode/InterpState.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ class InterpState final : public State, public SourceMapper {
5757
bool diagnosing() const { return getEvalStatus().Diag != nullptr; }
5858

5959
// Stack frame accessors.
60-
Frame *getSplitFrame() { return Parent.getCurrentFrame(); }
6160
Frame *getCurrentFrame() override;
6261
unsigned getCallStackDepth() override {
6362
return Current ? (Current->getDepth() + 1) : 1;
6463
}
65-
const Frame *getBottomFrame() const override {
66-
return Parent.getBottomFrame();
67-
}
64+
const Frame *getBottomFrame() const override { return &BottomFrame; }
6865

6966
// Access objects from the walker context.
7067
Expr::EvalStatus &getEvalStatus() const override {

0 commit comments

Comments
 (0)