Skip to content

Commit 081bc87

Browse files
committed
review: update namespace
- reduce namespace for brevity - remove introducing rs namespace and use new namespace instead
1 parent 7d78a34 commit 081bc87

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
namespace clang {
2929
namespace hlsl {
3030

31-
namespace rs = llvm::hlsl::root_signature;
32-
3331
struct RootSignatureToken {
3432
enum Kind {
3533
#define TOK(X) X,
@@ -100,7 +98,7 @@ class RootSignatureLexer {
10098

10199
class RootSignatureParser {
102100
public:
103-
RootSignatureParser(SmallVector<rs::RootElement> &Elements,
101+
RootSignatureParser(SmallVector<llvm::hlsl::rootsig::RootElement> &Elements,
104102
const SmallVector<RootSignatureToken> &Tokens,
105103
DiagnosticsEngine &Diags);
106104

@@ -126,16 +124,17 @@ class RootSignatureParser {
126124
// It is helpful to have a generalized dispatch method so that when we need
127125
// to parse multiple optional parameters in any order, we can invoke this
128126
// method
129-
bool ParseParam(rs::ParamType Ref);
127+
bool ParseParam(llvm::hlsl::rootsig::ParamType Ref);
130128

131129
// Parse as many optional parameters as possible in any order
132-
bool
133-
ParseOptionalParams(llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap);
130+
bool ParseOptionalParams(
131+
llvm::SmallDenseMap<TokenKind, llvm::hlsl::rootsig::ParamType> RefMap);
134132

135133
// Common parsing helpers
136-
bool ParseRegister(rs::Register *Reg);
134+
bool ParseRegister(llvm::hlsl::rootsig::Register *Reg);
137135
bool ParseUInt(uint32_t *X);
138-
bool ParseDescriptorRangeOffset(rs::DescriptorRangeOffset *X);
136+
bool
137+
ParseDescriptorRangeOffset(llvm::hlsl::rootsig::DescriptorRangeOffset *X);
139138

140139
// Various flags/enum parsing helpers
141140
template <bool AllowZero = false, typename EnumType>
@@ -144,8 +143,9 @@ class RootSignatureParser {
144143
template <typename FlagType>
145144
bool ParseFlags(llvm::SmallDenseMap<TokenKind, FlagType> EnumMap,
146145
FlagType *Enum);
147-
bool ParseDescriptorRangeFlags(rs::DescriptorRangeFlags *Enum);
148-
bool ParseShaderVisibility(rs::ShaderVisibility *Enum);
146+
bool
147+
ParseDescriptorRangeFlags(llvm::hlsl::rootsig::DescriptorRangeFlags *Enum);
148+
bool ParseShaderVisibility(llvm::hlsl::rootsig::ShaderVisibility *Enum);
149149

150150
// Increment the token iterator if we have not reached the end.
151151
// Return value denotes if we were already at the last token.
@@ -184,7 +184,7 @@ class RootSignatureParser {
184184
bool TryConsumeExpectedToken(ArrayRef<TokenKind> Expected);
185185

186186
private:
187-
SmallVector<rs::RootElement> &Elements;
187+
SmallVector<llvm::hlsl::rootsig::RootElement> &Elements;
188188
SmallVector<RootSignatureToken>::const_iterator CurTok;
189189
SmallVector<RootSignatureToken>::const_iterator LastTok;
190190

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "llvm/Support/raw_ostream.h"
44

5-
using namespace llvm::hlsl::root_signature;
5+
using namespace llvm::hlsl::rootsig;
66

77
namespace clang {
88
namespace hlsl {
@@ -364,7 +364,7 @@ bool RootSignatureParser::ParseDescriptorTableClause() {
364364
return true;
365365

366366
// Parse optional paramaters
367-
llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap = {
367+
llvm::SmallDenseMap<TokenKind, ParamType> RefMap = {
368368
{TokenKind::kw_numDescriptors, &Clause.NumDescriptors},
369369
{TokenKind::kw_space, &Clause.Space},
370370
{TokenKind::kw_offset, &Clause.Offset},
@@ -408,7 +408,7 @@ bool RootSignatureParser::ParseParam(ParamType Ref) {
408408
}
409409

410410
bool RootSignatureParser::ParseOptionalParams(
411-
llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap) {
411+
llvm::SmallDenseMap<TokenKind, ParamType> RefMap) {
412412
SmallVector<TokenKind> ParamKeywords;
413413
for (auto RefPair : RefMap)
414414
ParamKeywords.push_back(RefPair.first);

clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "gtest/gtest.h"
2525

2626
using namespace clang;
27-
using namespace llvm::hlsl::root_signature;
27+
using namespace llvm::hlsl::rootsig;
2828

2929
namespace {
3030

llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace llvm {
2121
namespace hlsl {
22-
namespace root_signature {
22+
namespace rootsig {
2323

2424
#define RS_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(Class) \
2525
inline Class operator|(Class a, Class b) { \
@@ -122,7 +122,7 @@ using RootElement = std::variant<DescriptorTable, DescriptorTableClause>;
122122
using ParamType = std::variant<uint32_t *, DescriptorRangeOffset *,
123123
DescriptorRangeFlags *, ShaderVisibility *>;
124124

125-
} // namespace root_signature
125+
} // namespace rootsig
126126
} // namespace hlsl
127127
} // namespace llvm
128128

0 commit comments

Comments
 (0)