Skip to content

Commit 36c3274

Browse files
committed
review: re-use getEnumName
1 parent 7ae77bf commit 36c3274

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ static raw_ostream &printFlags(raw_ostream &OS, const T Value,
5050
if (FlagSet)
5151
OS << " | ";
5252

53-
bool Found = false;
54-
for (const auto &FlagItem : Flags)
55-
if (FlagItem.Value == T(Bit)) {
56-
OS << FlagItem.Name;
57-
Found = true;
58-
break;
59-
}
60-
if (!Found)
53+
auto MaybeFlag = getEnumName(T(Bit), Flags);
54+
if (MaybeFlag)
55+
OS << *MaybeFlag;
56+
else
6157
OS << "invalid: " << Bit;
58+
6259
FlagSet = true;
6360
}
6461
Remaining &= ~Bit;

0 commit comments

Comments
 (0)