Skip to content

Commit afabdda

Browse files
committed
review: pass DenseMap by reference
1 parent 8a464ec commit afabdda

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class RootSignatureParser {
128128

129129
// Parse as many optional parameters as possible in any order
130130
bool ParseOptionalParams(
131-
llvm::SmallDenseMap<TokenKind, llvm::hlsl::rootsig::ParamType> RefMap);
131+
llvm::SmallDenseMap<TokenKind, llvm::hlsl::rootsig::ParamType> &RefMap);
132132

133133
// Common parsing helpers
134134
bool ParseRegister(llvm::hlsl::rootsig::Register *Reg);
@@ -138,10 +138,10 @@ class RootSignatureParser {
138138

139139
// Various flags/enum parsing helpers
140140
template <bool AllowZero = false, typename EnumType>
141-
bool ParseEnum(llvm::SmallDenseMap<TokenKind, EnumType> EnumMap,
141+
bool ParseEnum(llvm::SmallDenseMap<TokenKind, EnumType> &EnumMap,
142142
EnumType *Enum);
143143
template <typename FlagType>
144-
bool ParseFlags(llvm::SmallDenseMap<TokenKind, FlagType> EnumMap,
144+
bool ParseFlags(llvm::SmallDenseMap<TokenKind, FlagType> &EnumMap,
145145
FlagType *Enum);
146146
bool
147147
ParseDescriptorRangeFlags(llvm::hlsl::rootsig::DescriptorRangeFlags *Enum);

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ bool RootSignatureParser::ParseParam(ParamType Ref) {
379379
}
380380

381381
bool RootSignatureParser::ParseOptionalParams(
382-
llvm::SmallDenseMap<TokenKind, ParamType> RefMap) {
382+
llvm::SmallDenseMap<TokenKind, ParamType> &RefMap) {
383383
SmallVector<TokenKind> ParamKeywords;
384384
for (auto RefPair : RefMap)
385385
ParamKeywords.push_back(RefPair.first);
@@ -454,7 +454,7 @@ bool RootSignatureParser::ParseRegister(Register *Register) {
454454

455455
template <bool AllowZero, typename EnumType>
456456
bool RootSignatureParser::ParseEnum(
457-
llvm::SmallDenseMap<TokenKind, EnumType> EnumMap, EnumType *Enum) {
457+
llvm::SmallDenseMap<TokenKind, EnumType> &EnumMap, EnumType *Enum) {
458458
SmallVector<TokenKind> EnumToks;
459459
if (AllowZero)
460460
EnumToks.push_back(TokenKind::int_literal); // '0' is a valid flag value
@@ -489,7 +489,7 @@ bool RootSignatureParser::ParseEnum(
489489

490490
template <typename FlagType>
491491
bool RootSignatureParser::ParseFlags(
492-
llvm::SmallDenseMap<TokenKind, FlagType> FlagMap, FlagType *Flags) {
492+
llvm::SmallDenseMap<TokenKind, FlagType> &FlagMap, FlagType *Flags) {
493493
// Override the default value to 0 so that we can correctly 'or' the values
494494
*Flags = FlagType(0);
495495

0 commit comments

Comments
 (0)