Skip to content

Commit 8bcb061

Browse files
committed
review: update namespace
- reduce namespace for brevity - remove introducing rs namespace and use new namespace instead
1 parent ef28c05 commit 8bcb061

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,
@@ -87,7 +85,7 @@ class RootSignatureLexer {
8785

8886
class RootSignatureParser {
8987
public:
90-
RootSignatureParser(SmallVector<rs::RootElement> &Elements,
88+
RootSignatureParser(SmallVector<llvm::hlsl::rootsig::RootElement> &Elements,
9189
const SmallVector<RootSignatureToken> &Tokens,
9290
DiagnosticsEngine &Diags);
9391

@@ -113,16 +111,17 @@ class RootSignatureParser {
113111
// It is helpful to have a generalized dispatch method so that when we need
114112
// to parse multiple optional parameters in any order, we can invoke this
115113
// method
116-
bool ParseParam(rs::ParamType Ref);
114+
bool ParseParam(llvm::hlsl::rootsig::ParamType Ref);
117115

118116
// Parse as many optional parameters as possible in any order
119-
bool
120-
ParseOptionalParams(llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap);
117+
bool ParseOptionalParams(
118+
llvm::SmallDenseMap<TokenKind, llvm::hlsl::rootsig::ParamType> RefMap);
121119

122120
// Common parsing helpers
123-
bool ParseRegister(rs::Register *Reg);
121+
bool ParseRegister(llvm::hlsl::rootsig::Register *Reg);
124122
bool ParseUInt(uint32_t *X);
125-
bool ParseDescriptorRangeOffset(rs::DescriptorRangeOffset *X);
123+
bool
124+
ParseDescriptorRangeOffset(llvm::hlsl::rootsig::DescriptorRangeOffset *X);
126125

127126
// Various flags/enum parsing helpers
128127
template <bool AllowZero = false, typename EnumType>
@@ -131,8 +130,9 @@ class RootSignatureParser {
131130
template <typename FlagType>
132131
bool ParseFlags(llvm::SmallDenseMap<TokenKind, FlagType> EnumMap,
133132
FlagType *Enum);
134-
bool ParseDescriptorRangeFlags(rs::DescriptorRangeFlags *Enum);
135-
bool ParseShaderVisibility(rs::ShaderVisibility *Enum);
133+
bool
134+
ParseDescriptorRangeFlags(llvm::hlsl::rootsig::DescriptorRangeFlags *Enum);
135+
bool ParseShaderVisibility(llvm::hlsl::rootsig::ShaderVisibility *Enum);
136136

137137
// Increment the token iterator if we have not reached the end.
138138
// Return value denotes if we were already at the last token.
@@ -171,7 +171,7 @@ class RootSignatureParser {
171171
bool TryConsumeExpectedToken(ArrayRef<TokenKind> Expected);
172172

173173
private:
174-
SmallVector<rs::RootElement> &Elements;
174+
SmallVector<llvm::hlsl::rootsig::RootElement> &Elements;
175175
SmallVector<RootSignatureToken>::const_iterator CurTok;
176176
SmallVector<RootSignatureToken>::const_iterator LastTok;
177177

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 {
@@ -343,7 +343,7 @@ bool RootSignatureParser::ParseDescriptorTableClause() {
343343
return true;
344344

345345
// Parse optional paramaters
346-
llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap = {
346+
llvm::SmallDenseMap<TokenKind, ParamType> RefMap = {
347347
{TokenKind::kw_numDescriptors, &Clause.NumDescriptors},
348348
{TokenKind::kw_space, &Clause.Space},
349349
{TokenKind::kw_offset, &Clause.Offset},
@@ -387,7 +387,7 @@ bool RootSignatureParser::ParseParam(ParamType Ref) {
387387
}
388388

389389
bool RootSignatureParser::ParseOptionalParams(
390-
llvm::SmallDenseMap<TokenKind, rs::ParamType> RefMap) {
390+
llvm::SmallDenseMap<TokenKind, ParamType> RefMap) {
391391
SmallVector<TokenKind> ParamKeywords;
392392
for (auto RefPair : RefMap)
393393
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)