================
@@ -533,6 +533,18 @@ static Value *emitHlslClamp(CodeGenFunction &CGF, const 
CallExpr *E,
   return Clamp;
 }
 
+static CallInst *emitResourceIntrinsic(CodeGenFunction &CGF, llvm::Type *RetTy,
+                                       Intrinsic::ID ID,
+                                       ArrayRef<Value *> Args) {
+  SmallVector<llvm::Type *> ArgTys;
+  ArgTys.reserve(Args.size());
+  for (Value *Arg : Args)
+    ArgTys.push_back(Arg->getType());
+  Function *IntrFn = Intrinsic::getOrInsertDeclaration(&CGF.CGM.getModule(), 
ID,
+                                                       RetTy, ArgTys);
+  return CGF.EmitRuntimeCall(IntrFn, Args);
----------------
tcorringham wrote:

It is similar but not quite the same as it looks up the overloaded declaration, 
so it is just a convenient helper that avoids having to do this at each call 
site.
I have added a comment to describe why it exists and what to use it for.

https://github.com/llvm/llvm-project/pull/211256
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to