Skip to content

Commit

Permalink
[SCEVExpander] Remove unused variable [NFC]
Browse files Browse the repository at this point in the history
gcc warned about it:
 ../lib/Transforms/Utils/ScalarEvolutionExpander.cpp: In lambda function:
 ../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2104:22: warning: unused variable 'ARPtrTy' [-Wunused-variable]
  2104 |     if (PointerType *ARPtrTy = dyn_cast<PointerType>(ARTy)) {
       |                      ^~~~~~~
Fix the warning by removing the variable and turn dyn_cast into isa.
  • Loading branch information
mikaelholmen committed Sep 29, 2023
1 parent a0ea5a4 commit 02eb381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ Value *SCEVExpander::generateOverflowCheck(const SCEVAddRecExpr *AR,
bool NeedPosCheck = !SE.isKnownNegative(Step);
bool NeedNegCheck = !SE.isKnownPositive(Step);

if (PointerType *ARPtrTy = dyn_cast<PointerType>(ARTy)) {
if (isa<PointerType>(ARTy)) {
Value *NegMulV = Builder.CreateNeg(MulV);
if (NeedPosCheck)
Add = Builder.CreateGEP(Builder.getInt8Ty(), StartValue, MulV);
Expand Down

0 comments on commit 02eb381

Please sign in to comment.