[clang] [HLSL][NFC] Use method builder to create default resource constructor (PR #131384)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 16:48:06 PDT 2025


================
@@ -453,11 +481,11 @@ BuiltinTypeMethodBuilder &BuiltinTypeMethodBuilder::dereference(T Ptr) {
   return *this;
 }
 
-BuiltinTypeDeclBuilder &BuiltinTypeMethodBuilder::finalizeMethod() {
+BuiltinTypeDeclBuilder &BuiltinTypeMethodBuilder::finalize() {
   assert(!DeclBuilder.Record->isCompleteDefinition() &&
          "record is already complete");
-  assert(Method != nullptr &&
-         "method decl not created; are you missing a call to build the body?");
+
+  ensureCompleteDecl();
----------------
hekota wrote:

I don't think it is necessary since it is exactly what `ensureCompleteDecl` is doing - making sure Method is created.

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


More information about the cfe-commits mailing list