Skip to content

Commit 3f6cd76

Browse files
authored
[clang][bytecode] Remove InterpFrame::IsBottom flag (#159279)
The bottom frame is the one without a parent. No need to save that information separately.
1 parent 559cfef commit 3f6cd76

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

clang/lib/AST/ByteCode/InterpFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ using namespace clang::interp;
2424

2525
InterpFrame::InterpFrame(InterpState &S)
2626
: Caller(nullptr), S(S), Depth(0), Func(nullptr), RetPC(CodePtr()),
27-
ArgSize(0), Args(nullptr), FrameOffset(0), IsBottom(true) {}
27+
ArgSize(0), Args(nullptr), FrameOffset(0) {}
2828

2929
InterpFrame::InterpFrame(InterpState &S, const Function *Func,
3030
InterpFrame *Caller, CodePtr RetPC, unsigned ArgSize)
3131
: Caller(Caller), S(S), Depth(Caller ? Caller->Depth + 1 : 0), Func(Func),
3232
RetPC(RetPC), ArgSize(ArgSize), Args(static_cast<char *>(S.Stk.top())),
33-
FrameOffset(S.Stk.size()), IsBottom(!Caller) {
33+
FrameOffset(S.Stk.size()) {
3434
if (!Func)
3535
return;
3636

clang/lib/AST/ByteCode/InterpFrame.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class InterpFrame final : public Frame {
129129

130130
bool isStdFunction() const;
131131

132-
bool isBottomFrame() const { return IsBottom; }
132+
bool isBottomFrame() const { return !Caller; }
133133

134134
void dump() const { dump(llvm::errs(), 0); }
135135
void dump(llvm::raw_ostream &OS, unsigned Indent = 0) const;
@@ -179,7 +179,6 @@ class InterpFrame final : public Frame {
179179
const size_t FrameOffset;
180180
/// Mapping from arg offsets to their argument blocks.
181181
llvm::DenseMap<unsigned, std::unique_ptr<char[]>> Params;
182-
bool IsBottom = false;
183182
};
184183

185184
} // namespace interp

0 commit comments

Comments
 (0)