Skip to content

Commit c67cdcd

Browse files
committed
assert
1 parent 20440c3 commit c67cdcd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/IR/ProfDataUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ void llvm::setExplicitlyUnknownBranchWeightsIfProfiled(Instruction &I,
277277
StringRef PassName,
278278
const Function *F) {
279279
F = F ? F : I.getFunction();
280+
assert(F && "Either pass a instruction attached to a Function, or explicitly "
281+
"pass the Function that it will be attached to");
280282
if (std::optional<Function::ProfileCount> EC = F->getEntryCount();
281283
EC && EC->getCount() > 0)
282284
setExplicitlyUnknownBranchWeights(I, PassName);

0 commit comments

Comments
 (0)