Skip to content

Commit 85a1c58

Browse files
tbaederryuxuanchen1997
authored andcommitted
[clang][Interp][NFC] Remove Block::deref()
Summary: We already have Pointer::deref() Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251633
1 parent b6e8738 commit 85a1c58

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

clang/lib/AST/Interp/Interp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,7 @@ bool GetGlobalUnchecked(InterpState &S, CodePtr OpPC, uint32_t I) {
12521252
const Pointer &Ptr = S.P.getPtrGlobal(I);
12531253
if (!Ptr.isInitialized())
12541254
return false;
1255-
const Block *B = S.P.getGlobal(I);
1256-
S.Stk.push<T>(B->deref<T>());
1255+
S.Stk.push<T>(Ptr.deref<T>());
12571256
return true;
12581257
}
12591258

clang/lib/AST/Interp/InterpBlock.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ class Block final {
105105
return reinterpret_cast<const std::byte *>(this) + sizeof(Block);
106106
}
107107

108-
/// Returns a view over the data.
109-
template <typename T>
110-
T &deref() { return *reinterpret_cast<T *>(data()); }
111-
template <typename T> const T &deref() const {
112-
return *reinterpret_cast<const T *>(data());
113-
}
114-
115108
/// Invokes the constructor.
116109
void invokeCtor() {
117110
std::memset(rawData(), 0, Desc->getAllocSize());

0 commit comments

Comments
 (0)