Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions llvm/utils/TableGen/AsmMatcherEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class AsmMatcherInfo;
// RegisterSets can be seen in the outputted AsmMatcher tables occasionally, and
// can even affect compiler output (at least seen in diagnostics produced when
// all matches fail). So we use a type that sorts them consistently.
typedef std::set<const Record *, LessRecordByID> RegisterSet;
using RegisterSet = std::set<const Record *, LessRecordByID>;

class AsmMatcherEmitter {
const RecordKeeper &Records;
Expand Down Expand Up @@ -779,8 +779,8 @@ class AsmMatcherInfo {
std::vector<OperandMatchEntry> OperandMatchInfo;

/// Map of Register records to their class information.
typedef std::map<const Record *, ClassInfo *, LessRecordByID>
RegisterClassesTy;
using RegisterClassesTy =
std::map<const Record *, ClassInfo *, LessRecordByID>;
RegisterClassesTy RegisterClasses;

/// Map of Predicate records to their subtarget information.
Expand Down Expand Up @@ -1275,7 +1275,7 @@ void AsmMatcherInfo::buildRegisterClasses(
const auto &Registers = Target.getRegBank().getRegisters();
auto &RegClassList = Target.getRegBank().getRegClasses();

typedef std::set<RegisterSet, LessRegisterSet> RegisterSetSet;
using RegisterSetSet = std::set<RegisterSet, LessRegisterSet>;

// The register sets used for matching.
RegisterSetSet RegisterSets;
Expand Down Expand Up @@ -1515,7 +1515,7 @@ AsmMatcherInfo::AsmMatcherInfo(const Record *asmParser,
void AsmMatcherInfo::buildOperandMatchInfo() {
/// Map containing a mask with all operands indices that can be found for
/// that class inside a instruction.
typedef std::map<ClassInfo *, unsigned, deref<std::less<>>> OpClassMaskTy;
using OpClassMaskTy = std::map<ClassInfo *, unsigned, deref<std::less<>>>;
OpClassMaskTy OpClassMask;

bool CallCustomParserForAllOperands =
Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/AsmWriterEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ static unsigned CountNumOperands(StringRef AsmString, unsigned Variant) {
namespace {

struct AliasPriorityComparator {
typedef std::pair<CodeGenInstAlias, int> ValueType;
using ValueType = std::pair<CodeGenInstAlias, int>;
bool operator()(const ValueType &LHS, const ValueType &RHS) const {
if (LHS.second == RHS.second) {
// We don't actually care about the order, but for consistency it
Expand Down Expand Up @@ -845,8 +845,8 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
bool PassSubtarget = AsmWriter->getValueAsInt("PassSubtarget");

// Create a map from the qualified name to a list of potential matches.
typedef std::set<std::pair<CodeGenInstAlias, int>, AliasPriorityComparator>
AliasWithPriority;
using AliasWithPriority =
std::set<std::pair<CodeGenInstAlias, int>, AliasPriorityComparator>;
std::map<std::string, AliasWithPriority> AliasMap;
for (const Record *R : Records.getAllDerivedDefinitions("InstAlias")) {
int Priority = R->getValueAsInt("EmitPriority");
Expand Down
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/Basic/SequenceToOffsetTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ inline void printChar(raw_ostream &OS, char C) {
/// @tparam Less A stable comparator for SeqT elements.
template <typename SeqT, typename Less = std::less<typename SeqT::value_type>>
class SequenceToOffsetTable {
typedef typename SeqT::value_type ElemT;
using ElemT = typename SeqT::value_type;

// Define a comparator for SeqT that sorts a suffix immediately before a
// sequence with that suffix.
Expand All @@ -58,7 +58,7 @@ class SequenceToOffsetTable {

// Keep sequences ordered according to SeqLess so suffixes are easy to find.
// Map each sequence to its offset in the table.
typedef std::map<SeqT, unsigned, SeqLess> SeqMap;
using SeqMap = std::map<SeqT, unsigned, SeqLess>;

// Sequences added so far, with suffixes removed.
SeqMap Seqs;
Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/CodeGenMapTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
#include "llvm/TableGen/Record.h"

using namespace llvm;
typedef std::map<std::string, std::vector<const Record *>> InstrRelMapTy;
typedef std::map<std::vector<const Init *>, std::vector<const Record *>>
RowInstrMapTy;
using InstrRelMapTy = std::map<std::string, std::vector<const Record *>>;
using RowInstrMapTy =
std::map<std::vector<const Init *>, std::vector<const Record *>>;

namespace {

Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ struct TypeInfer {
};

/// 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.
Expand Down Expand Up @@ -1217,13 +1217,13 @@ class CodeGenDAGPatterns {
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);

Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/Common/CodeGenHwModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/Common/CodeGenInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ class CGIOperandList {
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(); }
Expand Down
7 changes: 3 additions & 4 deletions llvm/utils/TableGen/Common/CodeGenRegisters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
27 changes: 13 additions & 14 deletions llvm/utils/TableGen/Common/CodeGenRegisters.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ class CodeGenSubRegIndex {
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.
Expand Down Expand Up @@ -180,8 +179,8 @@ class CodeGenRegister {
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);

Expand Down Expand Up @@ -220,7 +219,7 @@ class CodeGenRegister {
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
Expand Down Expand Up @@ -248,8 +247,8 @@ class CodeGenRegister {
}

// 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;
Expand Down Expand Up @@ -281,7 +280,7 @@ class CodeGenRegister {
unsigned getWeight(const CodeGenRegBank &RegBank) const;

// Canonically ordered set.
typedef std::vector<const CodeGenRegister *> Vec;
using Vec = std::vector<const CodeGenRegister *>;

private:
bool SubRegsComplete;
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,10 @@ class RuleMatcher : public Matcher {

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.
Expand Down Expand Up @@ -1775,7 +1775,7 @@ class OneUsePredicateMatcher : public InstructionPredicateMatcher {
/// * 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;

Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/Common/InfoByHwMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions llvm/utils/TableGen/Common/InfoByHwMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
14 changes: 7 additions & 7 deletions llvm/utils/TableGen/FastISelEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ImmPredicateSet {

const TreePredicateFn &getPredicate(unsigned Idx) { return PredsByName[Idx]; }

typedef std::vector<TreePredicateFn>::const_iterator iterator;
using iterator = std::vector<TreePredicateFn>::const_iterator;
iterator begin() const { return PredsByName.begin(); }
iterator end() const { return PredsByName.end(); }
};
Expand Down Expand Up @@ -366,12 +366,12 @@ struct OperandsSignature {
class FastISelMap {
// A multimap is needed instead of a "plain" map because the key is
// the instruction's complexity (an int) and they are not unique.
typedef std::multimap<int, InstructionMemo> PredMap;
typedef std::map<MVT::SimpleValueType, PredMap> RetPredMap;
typedef std::map<MVT::SimpleValueType, RetPredMap> TypeRetPredMap;
typedef std::map<StringRef, TypeRetPredMap> OpcodeTypeRetPredMap;
typedef std::map<OperandsSignature, OpcodeTypeRetPredMap>
OperandsOpcodeTypeRetPredMap;
using PredMap = std::multimap<int, InstructionMemo>;
using RetPredMap = std::map<MVT::SimpleValueType, PredMap>;
using TypeRetPredMap = std::map<MVT::SimpleValueType, RetPredMap>;
using OpcodeTypeRetPredMap = std::map<StringRef, TypeRetPredMap>;
using OperandsOpcodeTypeRetPredMap =
std::map<OperandsSignature, OpcodeTypeRetPredMap>;

OperandsOpcodeTypeRetPredMap SimplePatterns;

Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/InstrInfoEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class InstrInfoEmitter {
void emitEnums(raw_ostream &OS,
ArrayRef<const CodeGenInstruction *> NumberedInstructions);

typedef std::vector<std::string> OperandInfoTy;
typedef std::vector<OperandInfoTy> OperandInfoListTy;
typedef std::map<OperandInfoTy, unsigned> OperandInfoMapTy;
using OperandInfoTy = std::vector<std::string>;
using OperandInfoListTy = std::vector<OperandInfoTy>;
using OperandInfoMapTy = std::map<OperandInfoTy, unsigned>;

/// Generate member functions in the target-specific GenInstrInfo class.
///
Expand Down
8 changes: 4 additions & 4 deletions llvm/utils/TableGen/OptionParserEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Option Parsing Definitions", OS);

// Generate prefix groups.
typedef SmallVector<SmallString<2>, 2> PrefixKeyT;
typedef std::map<PrefixKeyT, unsigned> PrefixesT;
using PrefixKeyT = SmallVector<SmallString<2>, 2>;
using PrefixesT = std::map<PrefixKeyT, unsigned>;
PrefixesT Prefixes;
Prefixes.try_emplace(PrefixKeyT(), 0);
for (const Record &R : llvm::make_pointee_range(Opts)) {
Expand All @@ -277,8 +277,8 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
}

// Generate sub command groups.
typedef SmallVector<StringRef, 2> SubCommandKeyT;
typedef std::map<SubCommandKeyT, unsigned> SubCommandIDsT;
using SubCommandKeyT = SmallVector<StringRef, 2>;
using SubCommandIDsT = std::map<SubCommandKeyT, unsigned>;
SubCommandIDsT SubCommandIDs;

auto PrintSubCommandIdsOffset = [&SubCommandIDs, &OS](const Record &R) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/RegisterBankEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace {
class RegisterBank {

/// A vector of register classes that are included in the register bank.
typedef std::vector<const CodeGenRegisterClass *> RegisterClassesTy;
using RegisterClassesTy = std::vector<const CodeGenRegisterClass *>;

private:
const Record &TheDef;
Expand Down
Loading