Skip to content

Commit 03d8e61

Browse files
committed
[Transforms] Fix -Wsign-compare in DemoteRegToStack.cpp (NFC)
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.
1 parent 9112073 commit 03d8e61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Utils/DemoteRegToStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ AllocaInst *llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
5151
(void)BB;
5252
}
5353
} else if (CallBrInst *CBI = dyn_cast<CallBrInst>(&I)) {
54-
for (int i = 0; i < CBI->getNumSuccessors(); i++) {
54+
for (unsigned i = 0; i < CBI->getNumSuccessors(); i++) {
5555
auto *Succ = CBI->getSuccessor(i);
5656
if (!Succ->getSinglePredecessor()) {
5757
assert(isCriticalEdge(II, i) && "Expected a critical edge!");

0 commit comments

Comments
 (0)