Skip to content

Revert "[HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses" #133790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions clang/include/clang/Basic/DiagnosticParseKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,4 @@ def err_hlsl_virtual_function
def err_hlsl_virtual_inheritance
: Error<"virtual inheritance is unsupported in HLSL">;

// HLSL Root Siganture diagnostic messages
def err_hlsl_unexpected_end_of_params
: Error<"expected %0 to denote end of parameters, or, another valid parameter of %1">;

} // end of Parser diagnostics
23 changes: 11 additions & 12 deletions clang/include/clang/Lex/HLSLRootSignatureTokenKinds.def
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
//===----------------------------------------------------------------------===//

#ifndef TOK
#define TOK(X, SPELLING)
#define TOK(X)
#endif
#ifndef PUNCTUATOR
#define PUNCTUATOR(X,Y) TOK(pu_ ## X, Y)
#define PUNCTUATOR(X,Y) TOK(pu_ ## X)
#endif
#ifndef KEYWORD
#define KEYWORD(X) TOK(kw_ ## X, #X)
#define KEYWORD(X) TOK(kw_ ## X)
#endif
#ifndef ENUM
#define ENUM(NAME, LIT) TOK(en_ ## NAME, LIT)
#define ENUM(NAME, LIT) TOK(en_ ## NAME)
#endif

// Defines the various types of enum
Expand All @@ -49,15 +49,15 @@
#endif

// General Tokens:
TOK(invalid, "invalid identifier")
TOK(end_of_stream, "end of stream")
TOK(int_literal, "integer literal")
TOK(invalid)
TOK(end_of_stream)
TOK(int_literal)

// Register Tokens:
TOK(bReg, "b register")
TOK(tReg, "t register")
TOK(uReg, "u register")
TOK(sReg, "s register")
TOK(bReg)
TOK(tReg)
TOK(uReg)
TOK(sReg)

// Punctuators:
PUNCTUATOR(l_paren, '(')
Expand All @@ -69,7 +69,6 @@ PUNCTUATOR(plus, '+')
PUNCTUATOR(minus, '-')

// RootElement Keywords:
KEYWORD(RootSignature) // used only for diagnostic messaging
KEYWORD(DescriptorTable)

// DescriptorTable Keywords:
Expand Down
15 changes: 1 addition & 14 deletions clang/include/clang/Lex/LexHLSLRootSignature.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#ifndef LLVM_CLANG_LEX_LEXHLSLROOTSIGNATURE_H
#define LLVM_CLANG_LEX_LEXHLSLROOTSIGNATURE_H

#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"

#include "llvm/ADT/SmallVector.h"
Expand All @@ -25,7 +24,7 @@ namespace hlsl {

struct RootSignatureToken {
enum Kind {
#define TOK(X, SPELLING) X,
#define TOK(X) X,
#include "clang/Lex/HLSLRootSignatureTokenKinds.def"
};

Expand All @@ -44,18 +43,6 @@ struct RootSignatureToken {
};
using TokenKind = enum RootSignatureToken::Kind;

inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
const TokenKind Kind) {
switch (Kind) {
#define TOK(X, SPELLING) \
case TokenKind::X: \
DB << SPELLING; \
break;
#include "clang/Lex/HLSLRootSignatureTokenKinds.def"
}
return DB;
}

class RootSignatureLexer {
public:
RootSignatureLexer(StringRef Signature, clang::SourceLocation SourceLoc)
Expand Down
107 changes: 0 additions & 107 deletions clang/include/clang/Parse/ParseHLSLRootSignature.h

This file was deleted.

1 change: 0 additions & 1 deletion clang/lib/Parse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_clang_library(clangParse
ParseExpr.cpp
ParseExprCXX.cpp
ParseHLSL.cpp
ParseHLSLRootSignature.cpp
ParseInit.cpp
ParseObjc.cpp
ParseOpenMP.cpp
Expand Down
166 changes: 0 additions & 166 deletions clang/lib/Parse/ParseHLSLRootSignature.cpp

This file was deleted.

1 change: 0 additions & 1 deletion clang/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ endfunction()

add_subdirectory(Basic)
add_subdirectory(Lex)
add_subdirectory(Parse)
add_subdirectory(Driver)
if(CLANG_ENABLE_STATIC_ANALYZER)
add_subdirectory(Analysis)
Expand Down
Loading
Loading