[llvm-branch-commits] [clang] [HLSL] Add binding attributes to resources from structs (PR #184731)

Helena Kotas via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 9 13:48:15 PDT 2026


================
@@ -163,6 +181,15 @@ static Builtin::ID getSpecConstBuiltinId(const Type *Type) {
   }
 }
 
+static StringRef createRegisterString(ASTContext &AST, RegisterType RegType,
+                                      unsigned N) {
+  llvm::SmallString<16> Buffer;
+  llvm::raw_svector_ostream OS(Buffer);
+  OS << getRegisterTypeChar(RegType);
+  OS << N;
+  return AST.backupStr(OS.str());
----------------
hekota wrote:

I don't think `Buffer` is initialized with zeros, and `AST.backupStr()` does not seem to be adding 0 at the end of the string either. It is returned as a `StringRef` though, so it is fine.

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


More information about the llvm-branch-commits mailing list