================
@@ -253,6 +253,23 @@ llvm::Constant *CodeGenModule::getBuiltinLibFunction(const
FunctionDecl *FD,
return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false);
}
+void appendDefaultIntrinsicArgs(SmallVectorImpl<llvm::Value *> &Args,
+ llvm::Function *F) {
+ llvm::FunctionType *FTy = F->getFunctionType();
+ if (Args.size() == FTy->getNumParams())
+ return;
+
+ auto [FirstDefault, Defaults] =
+ Intrinsic::getAllDefaultArgValues(F->getIntrinsicID());
+ for (unsigned I = Args.size(), E = FTy->getNumParams(); I != E; ++I) {
+ unsigned DefaultIdx = I - FirstDefault;
+ if (DefaultIdx < 0 || DefaultIdx >= Defaults.size())
----------------
Wolfram70 wrote:
Yes, that's true. On second thought, it seems better to have assertions here
instead of breaking on an `if`. Added assertions in the latest revision, thanks!
https://github.com/llvm/llvm-project/pull/214667
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits