[clang] [HLSL] Implement `Append` and `Consume` methods on `Append`/`ConsumeStructuredBuffer` (PR #118536)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 12:09:21 PST 2024


================
@@ -430,12 +432,20 @@ struct BuiltinTypeMethodBuilder {
   // Argument placeholders, inspired by std::placeholder. These are the indices
   // of arguments to forward to `callBuiltin`, and additionally `Handle` which
   // refers to the resource handle.
-  enum class PlaceHolder { _0, _1, _2, _3, Handle = 127 };
+  enum class PlaceHolder { _0, _1, _2, _3, Handle = 127, LastStmtPop = 128 };
----------------
bogner wrote:

Since we need more than one "special" placeholder it's probably better if they start counting at 128 (ie, `-1` if interpreted as a signed char) rather than 127. We also only need to explicitly number the first one and we can rely on auto-numbering after that I think.
```suggestion
  enum class PlaceHolder { _0, _1, _2, _3, Handle = 128, LastStmtPop};
```

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


More information about the cfe-commits mailing list