Skip to content

Commit

Permalink
[Transforms] Fix -Wsign-compare in DemoteRegToStack.cpp (NFC)
Browse files Browse the repository at this point in the history
llvm-project/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:54:23:
error: comparison of integers of different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
    for (int i = 0; i < CBI->getNumSuccessors(); i++) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
  • Loading branch information
DamonFool committed May 16, 2024
1 parent 9112073 commit 03d8e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ AllocaInst *llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
(void)BB;
}
} else if (CallBrInst *CBI = dyn_cast<CallBrInst>(&I)) {
for (int i = 0; i < CBI->getNumSuccessors(); i++) {
for (unsigned i = 0; i < CBI->getNumSuccessors(); i++) {
auto *Succ = CBI->getSuccessor(i);
if (!Succ->getSinglePredecessor()) {
assert(isCriticalEdge(II, i) && "Expected a critical edge!");
Expand Down

0 comments on commit 03d8e61

Please sign in to comment.