Skip to content

Commit 1ee6559

Browse files
Enna1vitalybuka
authored andcommitted
[ASAN] NFC: Remove redundant variable
`StackAlignment` has only one use: `StackAlignment = std::max(StackAlignment, AI.getAlignment());` So it is redundant. Reviewed By: vitalybuka, MTC Differential Revision: https://reviews.llvm.org/D106741
1 parent 00411eb commit 1ee6559

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,6 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
932932
SmallVector<AllocaInst *, 16> AllocaVec;
933933
SmallVector<AllocaInst *, 16> StaticAllocasToMoveUp;
934934
SmallVector<Instruction *, 8> RetVec;
935-
unsigned StackAlignment;
936935

937936
FunctionCallee AsanStackMallocFunc[kMaxAsanStackMallocSizeClass + 1],
938937
AsanStackFreeFunc[kMaxAsanStackMallocSizeClass + 1];
@@ -964,7 +963,6 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
964963
: F(F), ASan(ASan), DIB(*F.getParent(), /*AllowUnresolved*/ false),
965964
C(ASan.C), IntptrTy(ASan.IntptrTy),
966965
IntptrPtrTy(PointerType::get(IntptrTy, 0)), Mapping(ASan.Mapping),
967-
StackAlignment(1 << Mapping.Scale),
968966
PoisonStack(ClStack &&
969967
!Triple(F.getParent()->getTargetTriple()).isAMDGPU()) {}
970968

@@ -1088,7 +1086,6 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
10881086
return;
10891087
}
10901088

1091-
StackAlignment = std::max(StackAlignment, AI.getAlignment());
10921089
if (!AI.isStaticAlloca())
10931090
DynamicAllocaVec.push_back(&AI);
10941091
else

0 commit comments

Comments
 (0)