[clang] [HLSL] Resource initialization by constructors (PR #135120)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 11 12:22:54 PDT 2025


================
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
         RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(),
         ArrayRef<Value *>{HandleOp, IndexOp});
   }
+  case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: {
+    llvm::Type *HandleTy = CGM.getTypes().ConvertType(E->getType());
+    return llvm::PoisonValue::get(HandleTy);
+  }
+  case Builtin::BI__builtin_hlsl_resource_createhandlefrombinding: {
+    llvm::Type *HandleTy = CGM.getTypes().ConvertType(E->getType());
+    Value *RegisterNoOp = EmitScalarExpr(E->getArg(1));
----------------
hekota wrote:

No = number
Op = Operand
I'll rename it ;)

https://github.com/llvm/llvm-project/pull/135120


More information about the cfe-commits mailing list