Skip to content

Commit c677fee

Browse files
committed
review: pass DenseMap by reference
1 parent ae05366 commit c677fee

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
@@ -407,7 +407,7 @@ bool RootSignatureParser::ParseParam(ParamType Ref) {
407407
}
408408

409409
bool RootSignatureParser::ParseOptionalParams(
410-
llvm::SmallDenseMap<TokenKind, ParamType> RefMap) {
410+
llvm::SmallDenseMap<TokenKind, ParamType> &RefMap) {
411411
SmallVector<TokenKind> ParamKeywords;
412412
for (auto RefPair : RefMap)
413413
ParamKeywords.push_back(RefPair.first);
@@ -482,7 +482,7 @@ bool RootSignatureParser::ParseRegister(Register *Register) {
482482

483483
template <bool AllowZero, typename EnumType>
484484
bool RootSignatureParser::ParseEnum(
485-
llvm::SmallDenseMap<TokenKind, EnumType> EnumMap, EnumType *Enum) {
485+
llvm::SmallDenseMap<TokenKind, EnumType> &EnumMap, EnumType *Enum) {
486486
SmallVector<TokenKind> EnumToks;
487487
if (AllowZero)
488488
EnumToks.push_back(TokenKind::int_literal); // '0' is a valid flag value
@@ -517,7 +517,7 @@ bool RootSignatureParser::ParseEnum(
517517

518518
template <typename FlagType>
519519
bool RootSignatureParser::ParseFlags(
520-
llvm::SmallDenseMap<TokenKind, FlagType> FlagMap, FlagType *Flags) {
520+
llvm::SmallDenseMap<TokenKind, FlagType> &FlagMap, FlagType *Flags) {
521521
// Override the default value to 0 so that we can correctly 'or' the values
522522
*Flags = FlagType(0);
523523

0 commit comments

Comments
 (0)