Skip to content

Commit 3127683

Browse files
committed
fix build with latest LLVM
1 parent 135991e commit 3127683

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/quick-fuzz.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ class ValueGenerator {
546546
if (Op == Intrinsic::abs || Op == Intrinsic::ctlz || Op == Intrinsic::cttz)
547547
Args.push_back(ConstantInt::get(Type::getInt1Ty(Ctx), C.flip() ? 1 : 0));
548548

549-
auto Decl = Intrinsic::getDeclaration(M, Op, Ty);
549+
auto Decl = Intrinsic::getOrInsertDeclaration(M, Op, Ty);
550550
auto *I = CallInst::Create(Decl, Args, "", BB);
551551
return I;
552552
}
@@ -610,7 +610,7 @@ class ValueGenerator {
610610
assert(false);
611611
}
612612

613-
auto Decl = Intrinsic::getDeclaration(M, Op, Ty);
613+
auto Decl = Intrinsic::getOrInsertDeclaration(M, Op, Ty);
614614
auto *I = CallInst::Create(Decl, {LHS, RHS}, "", BB);
615615
if (Op == Intrinsic::ssub_with_overflow ||
616616
Op == Intrinsic::usub_with_overflow ||
@@ -664,7 +664,7 @@ class ValueGenerator {
664664
Type::getInt32Ty(BB->getContext()))
665665
: getVal(Ty);
666666

667-
auto Decl = Intrinsic::getDeclaration(M, Op, Ty);
667+
auto Decl = Intrinsic::getOrInsertDeclaration(M, Op, Ty);
668668
auto *I = CallInst::Create(Decl, {A, B, C}, "", BB);
669669
return I;
670670
}

0 commit comments

Comments
 (0)