================
@@ -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:

Thanks for these good suggestions! 
I have added a new version of EmitIntrinsicCall - my first attempt introduced 
an ambiguity which could be resolved by adding explicit casts in ambiguous call 
sites, but I changed that to reorder the args to avoid the ambiguity. 
I have also updated the tests to explicitly check the flags.

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