[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 27 14:57:02 PDT 2025
================
@@ -0,0 +1,188 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
+namespace clang {
+namespace hlsl {
+
+static std::string FormatTokenKinds(ArrayRef<TokenKind> Kinds) {
----------------
bogner wrote:
You can simplify this while also making it more efficient by implementing a `TokenFormatter` class with an `operator<<` for `DiagnosticBuilder`. The class should be okay to hold an `ArrayRef` as a member since it will always be used as a temporary, like `DB << TokenFormatter(Tokens);`
https://github.com/llvm/llvm-project/pull/133302
More information about the llvm-commits
mailing list