diff options
Diffstat (limited to 'llvm/utils/TableGen/Common')
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp | 6 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenDAGPatterns.h | 6 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenHwModes.h | 2 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenInstruction.h | 4 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenRegisters.cpp | 7 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/CodeGenRegisters.h | 27 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h | 10 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/InfoByHwMode.cpp | 2 | ||||
| -rw-r--r-- | llvm/utils/TableGen/Common/InfoByHwMode.h | 8 |
9 files changed, 35 insertions, 37 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp index 8076ce2..34355d5 100644 --- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp @@ -776,7 +776,7 @@ bool TypeInfer::EnforceSameSize(TypeSetByHwMode &A, TypeSetByHwMode &B) { if (B.empty()) Changed |= EnforceAny(B); - typedef SmallSet<TypeSize, 2, TypeSizeComparator> TypeSizeSet; + using TypeSizeSet = SmallSet<TypeSize, 2, TypeSizeComparator>; auto NoSize = [](const TypeSizeSet &Sizes, MVT T) -> bool { return !Sizes.contains(T.getSizeInBits()); @@ -4129,7 +4129,7 @@ void CodeGenDAGPatterns::ParseInstructions() { } } -typedef std::pair<TreePatternNode *, unsigned> NameRecord; +using NameRecord = std::pair<TreePatternNode *, unsigned>; static void FindNames(TreePatternNode &P, std::map<StringRef, NameRecord> &Names, @@ -4590,7 +4590,7 @@ void CodeGenDAGPatterns::ExpandHwModeBasedTypes() { } /// Dependent variable map for CodeGenDAGPattern variant generation -typedef StringMap<int> DepVarMap; +using DepVarMap = StringMap<int>; static void FindDepVarsOf(TreePatternNode &N, DepVarMap &DepMap) { if (N.isLeaf()) { diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h index 2ed8d13..aa9a0a4 100644 --- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h @@ -349,7 +349,7 @@ private: }; /// Set type used to track multiply used variables in patterns -typedef StringSet<> MultipleUseVarSet; +using MultipleUseVarSet = StringSet<>; /// SDTypeConstraint - This is a discriminated union of constraints, /// corresponding to the SDTypeConstraint tablegen class in Target.td. @@ -1217,13 +1217,13 @@ public: iterator_range<pf_iterator> ptfs() const { return PatternFragments; } // Patterns to match information. - typedef std::vector<PatternToMatch>::const_iterator ptm_iterator; + using ptm_iterator = std::vector<PatternToMatch>::const_iterator; ptm_iterator ptm_begin() const { return PatternsToMatch.begin(); } ptm_iterator ptm_end() const { return PatternsToMatch.end(); } iterator_range<ptm_iterator> ptms() const { return PatternsToMatch; } /// Parse the Pattern for an instruction, and insert the result in DAGInsts. - typedef std::map<const Record *, DAGInstruction, LessRecordByID> DAGInstMap; + using DAGInstMap = std::map<const Record *, DAGInstruction, LessRecordByID>; void parseInstructionPattern(CodeGenInstruction &CGI, const ListInit *Pattern, DAGInstMap &DAGInsts); diff --git a/llvm/utils/TableGen/Common/CodeGenHwModes.h b/llvm/utils/TableGen/Common/CodeGenHwModes.h index 5e1b31a..55062b6 100644 --- a/llvm/utils/TableGen/Common/CodeGenHwModes.h +++ b/llvm/utils/TableGen/Common/CodeGenHwModes.h @@ -36,7 +36,7 @@ struct HwMode { struct HwModeSelect { HwModeSelect(const Record *R, CodeGenHwModes &CGH); - typedef std::pair<unsigned, const Record *> PairType; + using PairType = std::pair<unsigned, const Record *>; std::vector<PairType> Items; void dump() const; }; diff --git a/llvm/utils/TableGen/Common/CodeGenInstruction.h b/llvm/utils/TableGen/Common/CodeGenInstruction.h index ed0bfa7..7295837 100644 --- a/llvm/utils/TableGen/Common/CodeGenInstruction.h +++ b/llvm/utils/TableGen/Common/CodeGenInstruction.h @@ -158,8 +158,8 @@ public: OperandInfo &back() { return OperandList.back(); } const OperandInfo &back() const { return OperandList.back(); } - typedef std::vector<OperandInfo>::iterator iterator; - typedef std::vector<OperandInfo>::const_iterator const_iterator; + using iterator = std::vector<OperandInfo>::iterator; + using const_iterator = std::vector<OperandInfo>::const_iterator; iterator begin() { return OperandList.begin(); } const_iterator begin() const { return OperandList.begin(); } iterator end() { return OperandList.end(); } diff --git a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp index 2eb94b7e..2f0ff3f 100644 --- a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp +++ b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp @@ -2163,7 +2163,7 @@ void CodeGenRegBank::computeRegUnitLaneMasks() { CodeGenRegister::RegUnitLaneMaskList RegUnitLaneMasks( RegUnits.count(), LaneBitmask::getAll()); // Iterate through SubRegisters. - typedef CodeGenRegister::SubRegMap SubRegMap; + using SubRegMap = CodeGenRegister::SubRegMap; const SubRegMap &SubRegs = Register.getSubRegs(); for (auto [SubRegIndex, SubReg] : SubRegs) { // Ignore non-leaf subregisters, their lane masks are fully covered by @@ -2282,9 +2282,8 @@ void CodeGenRegBank::inferCommonSubClass(CodeGenRegisterClass *RC) { // void CodeGenRegBank::inferSubClassWithSubReg(CodeGenRegisterClass *RC) { // Map SubRegIndex to set of registers in RC supporting that SubRegIndex. - typedef std::map<const CodeGenSubRegIndex *, CodeGenRegister::Vec, - deref<std::less<>>> - SubReg2SetMap; + using SubReg2SetMap = std::map<const CodeGenSubRegIndex *, + CodeGenRegister::Vec, deref<std::less<>>>; // Compute the set of registers supporting each SubRegIndex. SubReg2SetMap SRSets; diff --git a/llvm/utils/TableGen/Common/CodeGenRegisters.h b/llvm/utils/TableGen/Common/CodeGenRegisters.h index 89dac12..c02d04b 100644 --- a/llvm/utils/TableGen/Common/CodeGenRegisters.h +++ b/llvm/utils/TableGen/Common/CodeGenRegisters.h @@ -93,9 +93,8 @@ public: std::string getQualifiedName() const; // Map of composite subreg indices. - typedef std::map<CodeGenSubRegIndex *, CodeGenSubRegIndex *, - deref<std::less<>>> - CompMap; + using CompMap = + std::map<CodeGenSubRegIndex *, CodeGenSubRegIndex *, deref<std::less<>>>; // Returns the subreg index that results from composing this with Idx. // Returns NULL if this and Idx don't compose. @@ -180,8 +179,8 @@ public: bool Constant = false; // Map SubRegIndex -> Register. - typedef std::map<CodeGenSubRegIndex *, CodeGenRegister *, deref<std::less<>>> - SubRegMap; + using SubRegMap = + std::map<CodeGenSubRegIndex *, CodeGenRegister *, deref<std::less<>>>; CodeGenRegister(const Record *R, unsigned Enum); @@ -220,7 +219,7 @@ public: return SubReg2Idx.lookup(Reg); } - typedef std::vector<const CodeGenRegister *> SuperRegList; + using SuperRegList = std::vector<const CodeGenRegister *>; // Get the list of super-registers in topological order, small to large. // This is valid after computeSubRegs visits all registers during RegBank @@ -248,8 +247,8 @@ public: } // List of register units in ascending order. - typedef SparseBitVector<> RegUnitList; - typedef SmallVector<LaneBitmask, 16> RegUnitLaneMaskList; + using RegUnitList = SparseBitVector<>; + using RegUnitLaneMaskList = SmallVector<LaneBitmask, 16>; // How many entries in RegUnitList are native? RegUnitList NativeRegUnits; @@ -281,7 +280,7 @@ public: unsigned getWeight(const CodeGenRegBank &RegBank) const; // Canonically ordered set. - typedef std::vector<const CodeGenRegister *> Vec; + using Vec = std::vector<const CodeGenRegister *>; private: bool SubRegsComplete; @@ -590,7 +589,7 @@ struct RegUnit { // Each RegUnitSet is a sorted vector with a name. struct RegUnitSet { - typedef std::vector<unsigned>::const_iterator iterator; + using iterator = std::vector<unsigned>::const_iterator; std::string Name; std::vector<unsigned> Units; @@ -602,7 +601,7 @@ struct RegUnitSet { // Base vector for identifying TopoSigs. The contents uniquely identify a // TopoSig, only computeSuperRegs needs to know how. -typedef SmallVector<unsigned, 16> TopoSigId; +using TopoSigId = SmallVector<unsigned, 16>; // CodeGenRegBank - Represent a target's registers and the relations between // them. @@ -621,8 +620,8 @@ class CodeGenRegBank { CodeGenSubRegIndex *createSubRegIndex(StringRef Name, StringRef NameSpace); - typedef std::map<SmallVector<CodeGenSubRegIndex *, 8>, CodeGenSubRegIndex *> - ConcatIdxMap; + using ConcatIdxMap = + std::map<SmallVector<CodeGenSubRegIndex *, 8>, CodeGenSubRegIndex *>; ConcatIdxMap ConcatIdx; // Registers. @@ -639,7 +638,7 @@ class CodeGenRegBank { // Register classes. std::list<CodeGenRegisterClass> RegClasses; DenseMap<const Record *, CodeGenRegisterClass *> Def2RC; - typedef std::map<CodeGenRegisterClass::Key, CodeGenRegisterClass *> RCKeyMap; + using RCKeyMap = std::map<CodeGenRegisterClass::Key, CodeGenRegisterClass *>; RCKeyMap Key2RC; // Register categories. diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h index 84dfca4..d71fdb4 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h +++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h @@ -528,10 +528,10 @@ protected: ArrayRef<SMLoc> SrcLoc; - typedef std::tuple<const Record *, unsigned, unsigned> - DefinedComplexPatternSubOperand; - typedef StringMap<DefinedComplexPatternSubOperand> - DefinedComplexPatternSubOperandMap; + using DefinedComplexPatternSubOperand = + std::tuple<const Record *, unsigned, unsigned>; + using DefinedComplexPatternSubOperandMap = + StringMap<DefinedComplexPatternSubOperand>; /// A map of Symbolic Names to ComplexPattern sub-operands. DefinedComplexPatternSubOperandMap ComplexSubOperands; /// A map used to for multiple referenced error check of ComplexSubOperand. @@ -1775,7 +1775,7 @@ public: /// * Has an nsw/nuw flag or doesn't. class InstructionMatcher final : public PredicateListMatcher<PredicateMatcher> { protected: - typedef std::vector<std::unique_ptr<OperandMatcher>> OperandVec; + using OperandVec = std::vector<std::unique_ptr<OperandMatcher>>; RuleMatcher &Rule; diff --git a/llvm/utils/TableGen/Common/InfoByHwMode.cpp b/llvm/utils/TableGen/Common/InfoByHwMode.cpp index 2b3155c..a16fdbb 100644 --- a/llvm/utils/TableGen/Common/InfoByHwMode.cpp +++ b/llvm/utils/TableGen/Common/InfoByHwMode.cpp @@ -174,7 +174,7 @@ bool RegSizeInfoByHwMode::hasStricterSpillThan( } void RegSizeInfoByHwMode::writeToStream(raw_ostream &OS) const { - typedef decltype(Map)::value_type PairType; + using PairType = decltype(Map)::value_type; std::vector<const PairType *> Pairs; for (const auto &P : Map) Pairs.push_back(&P); diff --git a/llvm/utils/TableGen/Common/InfoByHwMode.h b/llvm/utils/TableGen/Common/InfoByHwMode.h index c730b73..ef688a6 100644 --- a/llvm/utils/TableGen/Common/InfoByHwMode.h +++ b/llvm/utils/TableGen/Common/InfoByHwMode.h @@ -87,10 +87,10 @@ void union_modes(const InfoByHwMode<InfoT> &A, const InfoByHwMode<InfoT> &B, } template <typename InfoT> struct InfoByHwMode { - typedef std::map<unsigned, InfoT> MapType; - typedef typename MapType::value_type PairType; - typedef typename MapType::iterator iterator; - typedef typename MapType::const_iterator const_iterator; + using MapType = std::map<unsigned, InfoT>; + using PairType = typename MapType::value_type; + using iterator = typename MapType::iterator; + using const_iterator = typename MapType::const_iterator; InfoByHwMode() = default; InfoByHwMode(const MapType &M) : Map(M) {} |
