diff options
author | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-07-06 14:16:38 -0700 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-07-07 09:28:28 -0700 |
commit | 91fe9e6ed39edfc4eea952355485fda3373bfe2e (patch) | |
tree | 870870c69b0a5d88d54eeb97025a99095b15fce2 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | ba4435eb62335af2339e3cd80c9663d6cca78cc7 (diff) | |
download | llvm-91fe9e6ed39edfc4eea952355485fda3373bfe2e.zip llvm-91fe9e6ed39edfc4eea952355485fda3373bfe2e.tar.gz llvm-91fe9e6ed39edfc4eea952355485fda3373bfe2e.tar.bz2 |
[TableGen] Move printing to stream directly to MachineValueTypeSet
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 9d6adb6d..e886962e 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -61,6 +61,17 @@ static bool berase_if(MachineValueTypeSet &S, Predicate P) { return Erased; } +void MachineValueTypeSet::writeToStream(raw_ostream &OS) const { + SmallVector<MVT, 4> Types(begin(), end()); + array_pod_sort(Types.begin(), Types.end()); + + OS << '['; + ListSeparator LS(" "); + for (const MVT &T : Types) + OS << LS << ValueTypeByHwMode::getMVTName(T); + OS << ']'; +} + // --- TypeSetByHwMode // This is a parameterized type-set class. For each mode there is a list @@ -193,22 +204,11 @@ void TypeSetByHwMode::writeToStream(raw_ostream &OS) const { OS << '{'; for (unsigned M : Modes) { OS << ' ' << getModeName(M) << ':'; - writeToStream(get(M), OS); + get(M).writeToStream(OS); } OS << " }"; } -void TypeSetByHwMode::writeToStream(const SetType &S, raw_ostream &OS) { - SmallVector<MVT, 4> Types(S.begin(), S.end()); - array_pod_sort(Types.begin(), Types.end()); - - OS << '['; - ListSeparator LS(" "); - for (const MVT &T : Types) - OS << LS << ValueTypeByHwMode::getMVTName(T); - OS << ']'; -} - bool TypeSetByHwMode::operator==(const TypeSetByHwMode &VTS) const { // The isSimple call is much quicker than hasDefault - check this first. bool IsSimple = isSimple(); @@ -253,6 +253,10 @@ bool TypeSetByHwMode::operator==(const TypeSetByHwMode &VTS) const { } namespace llvm { + raw_ostream &operator<<(raw_ostream &OS, const MachineValueTypeSet &T) { + T.writeToStream(OS); + return OS; + } raw_ostream &operator<<(raw_ostream &OS, const TypeSetByHwMode &T) { T.writeToStream(OS); return OS; |