Skip to content

Commit 9a6a468

Browse files
committed
review: explicitly return validity
1 parent 5398809 commit 9a6a468

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,17 @@ static bool isLoopMDCompatible(Module &M, Metadata *MD) {
357357
};
358358

359359
if (HintStr->getString() == "llvm.loop.unroll.count") {
360-
if (!ValidCountNode(HintMD))
361-
return reportLoopError(M, "Second operand of \"llvm.loop.unroll.count\" "
362-
"must be a constant integer");
363-
} else if (HintMD->getNumOperands() != 1)
364-
return reportLoopError(
360+
if (!ValidCountNode(HintMD)) {
361+
reportLoopError(M, "Second operand of \"llvm.loop.unroll.count\" "
362+
"must be a constant integer");
363+
return false;
364+
}
365+
} else if (HintMD->getNumOperands() != 1) {
366+
reportLoopError(
365367
M, "\"llvm.loop.unroll.disable\" and \"llvm.loop.unroll.disable\" "
366368
"must be provided as a single operand");
369+
return false;
370+
}
367371

368372
return true;
369373
}

0 commit comments

Comments
 (0)