[clang] [HLSL] Collect explicit resource binding information (PR #111203)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 13:38:03 PDT 2024


================
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
   llvm_unreachable("unexpected ResourceClass value");
 }
 
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the letter does not correspond to a valid register type.
+static bool convertToRegisterType(StringRef Slot, RegisterType *RT) {
----------------
hekota wrote:

Well, I tried to do it with `Expected<RegisterType>` and while does make the `convertToRegisterType` function smaller, checking of the results got more complicated because LLVM forces the error string/whatever to be checked. I'll leave it as is.

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


More information about the cfe-commits mailing list