Skip to content

Commit 4784585

Browse files
authored
[clang][bytecode][NFC] Remove unnecessary local variable (#152468)
Desc is only used once and we can get that information from the Block as well.
1 parent 474bbc1 commit 4784585

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clang/lib/AST/ByteCode/InterpState.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ bool InterpState::reportOverflow(const Expr *E, const llvm::APSInt &Value) {
7676

7777
void InterpState::deallocate(Block *B) {
7878
assert(B);
79-
const Descriptor *Desc = B->getDescriptor();
80-
assert(Desc);
81-
8279
// The block might have a pointer saved in a field in its data
8380
// that points to the block itself. We call the dtor first,
8481
// which will destroy all the data but leave InlineDescriptors
@@ -95,7 +92,7 @@ void InterpState::deallocate(Block *B) {
9592
auto *D = new (Memory) DeadBlock(DeadBlocks, B);
9693
// Since the block doesn't hold any actual data anymore, we can just
9794
// memcpy() everything over.
98-
std::memcpy(D->rawData(), B->rawData(), Desc->getAllocSize());
95+
std::memcpy(D->rawData(), B->rawData(), B->getSize());
9996
D->B.IsInitialized = B->IsInitialized;
10097

10198
// We moved the contents over to the DeadBlock.

0 commit comments

Comments
 (0)