Commit 8072bae1 by Andrew Scull

Refactor all instances of `typedef y x` to the C++11 `using x = y` syntax.

The C++11 syntax is more powerful as it also allows templating. This commit converts all type aliasing to the same syntax for consistency. BUG= R=jpp@chromium.org Review URL: https://codereview.chromium.org/1343843003 .
parent c31e2ed7
...@@ -163,20 +163,20 @@ public: ...@@ -163,20 +163,20 @@ public:
} }
// Operations to emit GPR instructions (and dispatch on operand type). // Operations to emit GPR instructions (and dispatch on operand type).
typedef void (AssemblerX86Base::*TypedEmitGPR)(Type, using TypedEmitGPR = void (AssemblerX86Base::*)(Type,
typename Traits::GPRRegister); typename Traits::GPRRegister);
typedef void (AssemblerX86Base::*TypedEmitAddr)( using TypedEmitAddr =
Type, const typename Traits::Address &); void (AssemblerX86Base::*)(Type, const typename Traits::Address &);
struct GPREmitterOneOp { struct GPREmitterOneOp {
TypedEmitGPR Reg; TypedEmitGPR Reg;
TypedEmitAddr Addr; TypedEmitAddr Addr;
}; };
typedef void (AssemblerX86Base::*TypedEmitGPRGPR)( using TypedEmitGPRGPR = void (AssemblerX86Base::*)(
Type, typename Traits::GPRRegister, typename Traits::GPRRegister); Type, typename Traits::GPRRegister, typename Traits::GPRRegister);
typedef void (AssemblerX86Base::*TypedEmitGPRAddr)( using TypedEmitGPRAddr = void (AssemblerX86Base::*)(
Type, typename Traits::GPRRegister, const typename Traits::Address &); Type, typename Traits::GPRRegister, const typename Traits::Address &);
typedef void (AssemblerX86Base::*TypedEmitGPRImm)( using TypedEmitGPRImm = void (AssemblerX86Base::*)(
Type, typename Traits::GPRRegister, const Immediate &); Type, typename Traits::GPRRegister, const Immediate &);
struct GPREmitterRegOp { struct GPREmitterRegOp {
TypedEmitGPRGPR GPRGPR; TypedEmitGPRGPR GPRGPR;
...@@ -191,7 +191,7 @@ public: ...@@ -191,7 +191,7 @@ public:
TypedEmitGPRImm GPRImm; TypedEmitGPRImm GPRImm;
}; };
typedef void (AssemblerX86Base::*TypedEmitGPRGPRImm)( using TypedEmitGPRGPRImm = void (AssemblerX86Base::*)(
Type, typename Traits::GPRRegister, typename Traits::GPRRegister, Type, typename Traits::GPRRegister, typename Traits::GPRRegister,
const Immediate &); const Immediate &);
struct GPREmitterShiftD { struct GPREmitterShiftD {
...@@ -201,9 +201,9 @@ public: ...@@ -201,9 +201,9 @@ public:
TypedEmitGPRGPRImm GPRGPRImm; TypedEmitGPRGPRImm GPRGPRImm;
}; };
typedef void (AssemblerX86Base::*TypedEmitAddrGPR)( using TypedEmitAddrGPR = void (AssemblerX86Base::*)(
Type, const typename Traits::Address &, typename Traits::GPRRegister); Type, const typename Traits::Address &, typename Traits::GPRRegister);
typedef void (AssemblerX86Base::*TypedEmitAddrImm)( using TypedEmitAddrImm = void (AssemblerX86Base::*)(
Type, const typename Traits::Address &, const Immediate &); Type, const typename Traits::Address &, const Immediate &);
struct GPREmitterAddrOp { struct GPREmitterAddrOp {
TypedEmitAddrGPR AddrGPR; TypedEmitAddrGPR AddrGPR;
...@@ -211,20 +211,20 @@ public: ...@@ -211,20 +211,20 @@ public:
}; };
// Operations to emit XMM instructions (and dispatch on operand type). // Operations to emit XMM instructions (and dispatch on operand type).
typedef void (AssemblerX86Base::*TypedEmitXmmXmm)( using TypedEmitXmmXmm = void (AssemblerX86Base::*)(
Type, typename Traits::XmmRegister, typename Traits::XmmRegister); Type, typename Traits::XmmRegister, typename Traits::XmmRegister);
typedef void (AssemblerX86Base::*TypedEmitXmmAddr)( using TypedEmitXmmAddr = void (AssemblerX86Base::*)(
Type, typename Traits::XmmRegister, const typename Traits::Address &); Type, typename Traits::XmmRegister, const typename Traits::Address &);
struct XmmEmitterRegOp { struct XmmEmitterRegOp {
TypedEmitXmmXmm XmmXmm; TypedEmitXmmXmm XmmXmm;
TypedEmitXmmAddr XmmAddr; TypedEmitXmmAddr XmmAddr;
}; };
typedef void (AssemblerX86Base::*EmitXmmXmm)(typename Traits::XmmRegister, using EmitXmmXmm = void (AssemblerX86Base::*)(typename Traits::XmmRegister,
typename Traits::XmmRegister); typename Traits::XmmRegister);
typedef void (AssemblerX86Base::*EmitXmmAddr)( using EmitXmmAddr = void (AssemblerX86Base::*)(
typename Traits::XmmRegister, const typename Traits::Address &); typename Traits::XmmRegister, const typename Traits::Address &);
typedef void (AssemblerX86Base::*EmitAddrXmm)( using EmitAddrXmm = void (AssemblerX86Base::*)(
const typename Traits::Address &, typename Traits::XmmRegister); const typename Traits::Address &, typename Traits::XmmRegister);
struct XmmEmitterMovOps { struct XmmEmitterMovOps {
EmitXmmXmm XmmXmm; EmitXmmXmm XmmXmm;
...@@ -232,7 +232,7 @@ public: ...@@ -232,7 +232,7 @@ public:
EmitAddrXmm AddrXmm; EmitAddrXmm AddrXmm;
}; };
typedef void (AssemblerX86Base::*TypedEmitXmmImm)( using TypedEmitXmmImm = void (AssemblerX86Base::*)(
Type, typename Traits::XmmRegister, const Immediate &); Type, typename Traits::XmmRegister, const Immediate &);
struct XmmEmitterShiftOp { struct XmmEmitterShiftOp {
...@@ -243,8 +243,9 @@ public: ...@@ -243,8 +243,9 @@ public:
// Cross Xmm/GPR cast instructions. // Cross Xmm/GPR cast instructions.
template <typename DReg_t, typename SReg_t> struct CastEmitterRegOp { template <typename DReg_t, typename SReg_t> struct CastEmitterRegOp {
typedef void (AssemblerX86Base::*TypedEmitRegs)(Type, DReg_t, Type, SReg_t); using TypedEmitRegs = void (AssemblerX86Base::*)(Type, DReg_t, Type,
typedef void (AssemblerX86Base::*TypedEmitAddr)( SReg_t);
using TypedEmitAddr = void (AssemblerX86Base::*)(
Type, DReg_t, Type, const typename Traits::Address &); Type, DReg_t, Type, const typename Traits::Address &);
TypedEmitRegs RegReg; TypedEmitRegs RegReg;
...@@ -254,9 +255,9 @@ public: ...@@ -254,9 +255,9 @@ public:
// Three operand (potentially) cross Xmm/GPR instructions. // Three operand (potentially) cross Xmm/GPR instructions.
// The last operand must be an immediate. // The last operand must be an immediate.
template <typename DReg_t, typename SReg_t> struct ThreeOpImmEmitter { template <typename DReg_t, typename SReg_t> struct ThreeOpImmEmitter {
typedef void (AssemblerX86Base::*TypedEmitRegRegImm)(Type, DReg_t, SReg_t, using TypedEmitRegRegImm = void (AssemblerX86Base::*)(Type, DReg_t, SReg_t,
const Immediate &); const Immediate &);
typedef void (AssemblerX86Base::*TypedEmitRegAddrImm)( using TypedEmitRegAddrImm = void (AssemblerX86Base::*)(
Type, DReg_t, const typename Traits::Address &, const Immediate &); Type, DReg_t, const typename Traits::Address &, const Immediate &);
TypedEmitRegRegImm RegRegImm; TypedEmitRegRegImm RegRegImm;
...@@ -897,7 +898,7 @@ private: ...@@ -897,7 +898,7 @@ private:
const typename Traits::Operand &operand, const typename Traits::Operand &operand,
typename Traits::GPRRegister shifter); typename Traits::GPRRegister shifter);
typedef std::vector<Label *> LabelVector; using LabelVector = std::vector<Label *>;
// A vector of pool-allocated x86 labels for CFG nodes. // A vector of pool-allocated x86 labels for CFG nodes.
LabelVector CfgNodeLabels; LabelVector CfgNodeLabels;
// A vector of pool-allocated x86 labels for Local labels. // A vector of pool-allocated x86 labels for Local labels.
......
...@@ -311,7 +311,7 @@ void Cfg::advancedPhiLowering() { ...@@ -311,7 +311,7 @@ void Cfg::advancedPhiLowering() {
void Cfg::reorderNodes() { void Cfg::reorderNodes() {
// TODO(ascull): it would be nice if the switch tests were always followed // TODO(ascull): it would be nice if the switch tests were always followed
// by the default case to allow for fall through. // by the default case to allow for fall through.
typedef std::list<CfgNode *> PlacedList; using PlacedList = std::list<CfgNode *>;
PlacedList Placed; // Nodes with relative placement locked down PlacedList Placed; // Nodes with relative placement locked down
PlacedList Unreachable; // Unreachable nodes PlacedList Unreachable; // Unreachable nodes
PlacedList::iterator NoPlace = Placed.end(); PlacedList::iterator NoPlace = Placed.end();
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
void swapNodes(NodeList &NewNodes); void swapNodes(NodeList &NewNodes);
/// @} /// @}
typedef int32_t IdentifierIndexType; using IdentifierIndexType = int32_t;
/// Adds a name to the list and returns its index, suitable for the /// Adds a name to the list and returns its index, suitable for the
/// argument to getIdentifierName(). No checking for duplicates is /// argument to getIdentifierName(). No checking for duplicates is
/// done. This is generally used for node names and variable names /// done. This is generally used for node names and variable names
......
...@@ -48,8 +48,8 @@ public: ...@@ -48,8 +48,8 @@ public:
private: private:
llvm::Module *Mod; llvm::Module *Mod;
typedef std::map<const llvm::GlobalValue *, GlobalDeclaration *> using GlobalDeclarationMapType =
GlobalDeclarationMapType; std::map<const llvm::GlobalValue *, GlobalDeclaration *>;
GlobalDeclarationMapType GlobalDeclarationMap; GlobalDeclarationMapType GlobalDeclarationMap;
/// Walks module and generates names for unnamed globals using prefix /// Walks module and generates names for unnamed globals using prefix
......
...@@ -138,42 +138,42 @@ static std::unique_ptr<T> makeUnique(Args &&... TheArgs) { ...@@ -138,42 +138,42 @@ static std::unique_ptr<T> makeUnique(Args &&... TheArgs) {
#define ENABLE_MAKE_UNIQUE friend struct ::Ice::Internal::MakeUniqueEnabler #define ENABLE_MAKE_UNIQUE friend struct ::Ice::Internal::MakeUniqueEnabler
typedef std::string IceString; using IceString = std::string;
typedef llvm::ilist<Inst> InstList; using InstList = llvm::ilist<Inst>;
// Ideally PhiList would be llvm::ilist<InstPhi>, and similar for // Ideally PhiList would be llvm::ilist<InstPhi>, and similar for
// AssignList, but this runs into issues with SFINAE. // AssignList, but this runs into issues with SFINAE.
typedef InstList PhiList; using PhiList = InstList;
typedef InstList AssignList; using AssignList = InstList;
// Containers that are arena-allocated from the Cfg's allocator. // Containers that are arena-allocated from the Cfg's allocator.
typedef std::vector<Operand *, CfgLocalAllocator<Operand *>> OperandList; using OperandList = std::vector<Operand *, CfgLocalAllocator<Operand *>>;
typedef std::vector<Variable *, CfgLocalAllocator<Variable *>> VarList; using VarList = std::vector<Variable *, CfgLocalAllocator<Variable *>>;
typedef std::vector<CfgNode *, CfgLocalAllocator<CfgNode *>> NodeList; using NodeList = std::vector<CfgNode *, CfgLocalAllocator<CfgNode *>>;
// Contains that use the default (global) allocator. // Contains that use the default (global) allocator.
typedef std::vector<Constant *> ConstantList; using ConstantList = std::vector<Constant *>;
typedef std::vector<FunctionDeclaration *> FunctionDeclarationList; using FunctionDeclarationList = std::vector<FunctionDeclaration *>;
typedef std::vector<VariableDeclaration *> VariableDeclarationList; using VariableDeclarationList = std::vector<VariableDeclaration *>;
/// SizeT is for holding small-ish limits like number of source /// SizeT is for holding small-ish limits like number of source
/// operands in an instruction. It is used instead of size_t (which /// operands in an instruction. It is used instead of size_t (which
/// may be 64-bits wide) when we want to save space. /// may be 64-bits wide) when we want to save space.
typedef uint32_t SizeT; using SizeT = uint32_t;
/// InstNumberT is for holding an instruction number. Instruction /// InstNumberT is for holding an instruction number. Instruction
/// numbers are used for representing Variable live ranges. /// numbers are used for representing Variable live ranges.
typedef int32_t InstNumberT; using InstNumberT = int32_t;
/// A LiveBeginEndMapEntry maps a Variable::Number value to an /// A LiveBeginEndMapEntry maps a Variable::Number value to an
/// Inst::Number value, giving the instruction number that begins or /// Inst::Number value, giving the instruction number that begins or
/// ends a variable's live range. /// ends a variable's live range.
typedef std::pair<SizeT, InstNumberT> LiveBeginEndMapEntry; using LiveBeginEndMapEntry = std::pair<SizeT, InstNumberT>;
typedef std::vector<LiveBeginEndMapEntry, using LiveBeginEndMap =
CfgLocalAllocator<LiveBeginEndMapEntry>> LiveBeginEndMap; std::vector<LiveBeginEndMapEntry, CfgLocalAllocator<LiveBeginEndMapEntry>>;
typedef llvm::BitVector LivenessBV; using LivenessBV = llvm::BitVector;
typedef uint32_t TimerStackIdT; using TimerStackIdT = uint32_t;
typedef uint32_t TimerIdT; using TimerIdT = uint32_t;
/// Use alignas(MaxCacheLineSize) to isolate variables/fields that /// Use alignas(MaxCacheLineSize) to isolate variables/fields that
/// might be contended while multithreading. Assumes the maximum cache /// might be contended while multithreading. Assumes the maximum cache
...@@ -187,7 +187,7 @@ enum { MaxCacheLineSize = 64 }; ...@@ -187,7 +187,7 @@ enum { MaxCacheLineSize = 64 };
__attribute__((aligned(MaxCacheLineSize + 0))) int : 0 __attribute__((aligned(MaxCacheLineSize + 0))) int : 0
/// PNaCl is ILP32, so theoretically we should only need 32-bit offsets. /// PNaCl is ILP32, so theoretically we should only need 32-bit offsets.
typedef int32_t RelocOffsetT; using RelocOffsetT = int32_t;
enum { RelocAddrSize = 4 }; enum { RelocAddrSize = 4 };
enum LivenessMode { enum LivenessMode {
...@@ -229,7 +229,7 @@ enum VerboseItem { ...@@ -229,7 +229,7 @@ enum VerboseItem {
IceV_All = ~IceV_None, IceV_All = ~IceV_None,
IceV_Most = IceV_All & ~IceV_LinearScan IceV_Most = IceV_All & ~IceV_LinearScan
}; };
typedef uint32_t VerboseMask; using VerboseMask = uint32_t;
enum FileType { enum FileType {
FT_Elf, /// ELF .o file FT_Elf, /// ELF .o file
...@@ -237,10 +237,10 @@ enum FileType { ...@@ -237,10 +237,10 @@ enum FileType {
FT_Iasm /// "Integrated assembler" .byte-style .s file FT_Iasm /// "Integrated assembler" .byte-style .s file
}; };
typedef llvm::raw_ostream Ostream; using Ostream = llvm::raw_ostream;
typedef llvm::raw_fd_ostream Fdstream; using Fdstream = llvm::raw_fd_ostream;
typedef std::mutex GlobalLockType; using GlobalLockType = std::mutex;
enum ErrorCodes { EC_None = 0, EC_Args, EC_Bitcode, EC_Translation }; enum ErrorCodes { EC_None = 0, EC_Args, EC_Bitcode, EC_Translation };
......
...@@ -97,10 +97,10 @@ private: ...@@ -97,10 +97,10 @@ private:
bool ELF64; bool ELF64;
// All created sections, separated into different pools. // All created sections, separated into different pools.
typedef std::vector<ELFSection *> SectionList; using SectionList = std::vector<ELFSection *>;
typedef std::vector<ELFTextSection *> TextSectionList; using TextSectionList = std::vector<ELFTextSection *>;
typedef std::vector<ELFDataSection *> DataSectionList; using DataSectionList = std::vector<ELFDataSection *>;
typedef std::vector<ELFRelocationSection *> RelSectionList; using RelSectionList = std::vector<ELFRelocationSection *>;
TextSectionList TextSections; TextSectionList TextSections;
RelSectionList RelTextSections; RelSectionList RelTextSections;
DataSectionList DataSections; DataSectionList DataSections;
......
...@@ -200,8 +200,8 @@ public: ...@@ -200,8 +200,8 @@ public:
private: private:
// Map from symbol name to its symbol information. // Map from symbol name to its symbol information.
// This assumes symbols are unique across all sections. // This assumes symbols are unique across all sections.
typedef IceString SymtabKey; using SymtabKey = IceString;
typedef std::map<SymtabKey, ELFSym> SymMap; using SymMap = std::map<SymtabKey, ELFSym>;
template <bool IsELF64> template <bool IsELF64>
void writeSymbolMap(ELFStreamer &Str, const SymMap &Map); void writeSymbolMap(ELFStreamer &Str, const SymMap &Map);
...@@ -299,13 +299,13 @@ private: ...@@ -299,13 +299,13 @@ private:
bool operator()(const IceString &StrA, const IceString &StrB) const; bool operator()(const IceString &StrA, const IceString &StrB) const;
}; };
typedef std::map<IceString, size_t, SuffixComparator> StringToIndexType; using StringToIndexType = std::map<IceString, size_t, SuffixComparator>;
/// Track strings to their index. Index will be UnknownIndex if not /// Track strings to their index. Index will be UnknownIndex if not
/// yet laid out. /// yet laid out.
StringToIndexType StringToIndexMap; StringToIndexType StringToIndexMap;
typedef std::vector<uint8_t> RawDataType; using RawDataType = std::vector<uint8_t>;
RawDataType StringData; RawDataType StringData;
}; };
......
...@@ -21,7 +21,7 @@ namespace Ice { ...@@ -21,7 +21,7 @@ namespace Ice {
/// Each target and container format has a different namespace of relocations. /// Each target and container format has a different namespace of relocations.
/// This holds the specific target+container format's relocation number. /// This holds the specific target+container format's relocation number.
typedef uint32_t FixupKind; using FixupKind = uint32_t;
/// Assembler fixups are positions in generated code/data that hold relocation /// Assembler fixups are positions in generated code/data that hold relocation
/// information that needs to be processed before finalizing the code/data. /// information that needs to be processed before finalizing the code/data.
...@@ -53,8 +53,8 @@ private: ...@@ -53,8 +53,8 @@ private:
const Constant *value_ = nullptr; const Constant *value_ = nullptr;
}; };
typedef std::vector<AssemblerFixup> FixupList; using FixupList = std::vector<AssemblerFixup>;
typedef std::vector<AssemblerFixup *> FixupRefList; using FixupRefList = std::vector<AssemblerFixup *>;
} // end of namespace Ice } // end of namespace Ice
......
...@@ -80,7 +80,7 @@ struct KeyCompareLess<ValueType, ...@@ -80,7 +80,7 @@ struct KeyCompareLess<ValueType,
typename std::enable_if<std::is_floating_point< typename std::enable_if<std::is_floating_point<
typename ValueType::PrimType>::value>::type> { typename ValueType::PrimType>::value>::type> {
bool operator()(const Constant *Const1, const Constant *Const2) const { bool operator()(const Constant *Const1, const Constant *Const2) const {
typedef uint64_t CompareType; using CompareType = uint64_t;
static_assert(sizeof(typename ValueType::PrimType) <= sizeof(CompareType), static_assert(sizeof(typename ValueType::PrimType) <= sizeof(CompareType),
"Expected floating-point type of width 64-bit or less"); "Expected floating-point type of width 64-bit or less");
typename ValueType::PrimType V1 = llvm::cast<ValueType>(Const1)->getValue(); typename ValueType::PrimType V1 = llvm::cast<ValueType>(Const1)->getValue();
...@@ -139,23 +139,23 @@ public: ...@@ -139,23 +139,23 @@ public:
Constants.reserve(Pool.size()); Constants.reserve(Pool.size());
for (auto &I : Pool) for (auto &I : Pool)
Constants.push_back(I.second); Constants.push_back(I.second);
// The sort (and its KeyCompareLess machinery) is not strictly // The sort (and its KeyCompareLess machinery) is not strictly necessary,
// necessary, but is desirable for producing output that is // but is desirable for producing output that is deterministic across
// deterministic across unordered_map::iterator implementations. // unordered_map::iterator implementations.
std::sort(Constants.begin(), Constants.end(), KeyCompareLess<ValueType>()); std::sort(Constants.begin(), Constants.end(), KeyCompareLess<ValueType>());
return Constants; return Constants;
} }
private: private:
// Use the default hash function, and a custom key comparison // Use the default hash function, and a custom key comparison function. The
// function. The key comparison function for floating point // key comparison function for floating point variables can't use the default
// variables can't use the default == based implementation because // == based implementation because of special C++ semantics regarding +0.0,
// of special C++ semantics regarding +0.0, -0.0, and NaN // -0.0, and NaN comparison. However, it's OK to use the default hash for
// comparison. However, it's OK to use the default hash for // floating point values because KeyCompare is the final source of truth - in
// floating point values because KeyCompare is the final source of // the worst case a "false" collision must be resolved.
// truth - in the worst case a "false" collision must be resolved. using ContainerType =
typedef std::unordered_map<KeyType, ValueType *, std::hash<KeyType>, std::unordered_map<KeyType, ValueType *, std::hash<KeyType>,
KeyCompare<KeyType>> ContainerType; KeyCompare<KeyType>>;
ContainerType Pool; ContainerType Pool;
uint32_t NextPoolID = 0; uint32_t NextPoolID = 0;
}; };
......
...@@ -447,7 +447,7 @@ private: ...@@ -447,7 +447,7 @@ private:
ICE_CACHELINE_BOUNDARY; ICE_CACHELINE_BOUNDARY;
// Managed by getDestructors() // Managed by getDestructors()
typedef std::vector<std::function<void()>> DestructorArray; using DestructorArray = std::vector<std::function<void()>>;
GlobalLockType DestructorsLock; GlobalLockType DestructorsLock;
DestructorArray Destructors; DestructorArray Destructors;
...@@ -478,7 +478,7 @@ private: ...@@ -478,7 +478,7 @@ private:
ICE_CACHELINE_BOUNDARY; ICE_CACHELINE_BOUNDARY;
/// StrLock is a global lock on the dump and emit output streams. /// StrLock is a global lock on the dump and emit output streams.
typedef std::mutex StrLockType; using StrLockType = std::mutex;
StrLockType StrLock; StrLockType StrLock;
Ostream *StrDump; /// Stream for dumping / diagnostics Ostream *StrDump; /// Stream for dumping / diagnostics
Ostream *StrEmit; /// Stream for code emission Ostream *StrEmit; /// Stream for code emission
...@@ -545,7 +545,7 @@ private: ...@@ -545,7 +545,7 @@ private:
ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS); ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS);
// Private helpers for mangleName() // Private helpers for mangleName()
typedef llvm::SmallVector<char, 32> ManglerVector; using ManglerVector = llvm::SmallVector<char, 32>;
void incrementSubstitutions(ManglerVector &OldName) const; void incrementSubstitutions(ManglerVector &OldName) const;
public: public:
......
...@@ -172,7 +172,7 @@ public: ...@@ -172,7 +172,7 @@ public:
}; };
/// Models the data in a data initializer. /// Models the data in a data initializer.
typedef std::vector<char> DataVecType; using DataVecType = std::vector<char>;
/// Defines a sequence of byte values as a data initializer. /// Defines a sequence of byte values as a data initializer.
class DataInitializer : public Initializer { class DataInitializer : public Initializer {
...@@ -269,7 +269,7 @@ public: ...@@ -269,7 +269,7 @@ public:
}; };
/// Models the list of initializers. /// Models the list of initializers.
typedef std::vector<std::unique_ptr<Initializer>> InitializerListType; using InitializerListType = std::vector<std::unique_ptr<Initializer>>;
static VariableDeclaration *create(GlobalContext *Context) { static VariableDeclaration *create(GlobalContext *Context) {
return new (Context->allocate<VariableDeclaration>()) VariableDeclaration(); return new (Context->allocate<VariableDeclaration>()) VariableDeclaration();
......
...@@ -215,7 +215,7 @@ protected: ...@@ -215,7 +215,7 @@ protected:
/// mapped to one bit position of the LiveRangesEnded bit vector. /// mapped to one bit position of the LiveRangesEnded bit vector.
/// Only the first CHAR_BIT * sizeof(LREndedBits) variables are /// Only the first CHAR_BIT * sizeof(LREndedBits) variables are
/// tracked this way. /// tracked this way.
typedef uint32_t LREndedBits; // only first 32 src operands tracked, sorry using LREndedBits = uint32_t; // only first 32 src operands tracked, sorry
LREndedBits LiveRangesEnded; LREndedBits LiveRangesEnded;
}; };
......
...@@ -759,52 +759,52 @@ private: ...@@ -759,52 +759,52 @@ private:
static const char *Opcode; static const char *Opcode;
}; };
typedef InstARM32ThreeAddrGPR<InstARM32::Adc> InstARM32Adc; using InstARM32Adc = InstARM32ThreeAddrGPR<InstARM32::Adc>;
typedef InstARM32ThreeAddrGPR<InstARM32::Add> InstARM32Add; using InstARM32Add = InstARM32ThreeAddrGPR<InstARM32::Add>;
typedef InstARM32ThreeAddrGPR<InstARM32::And> InstARM32And; using InstARM32And = InstARM32ThreeAddrGPR<InstARM32::And>;
typedef InstARM32ThreeAddrGPR<InstARM32::Asr> InstARM32Asr; using InstARM32Asr = InstARM32ThreeAddrGPR<InstARM32::Asr>;
typedef InstARM32ThreeAddrGPR<InstARM32::Bic> InstARM32Bic; using InstARM32Bic = InstARM32ThreeAddrGPR<InstARM32::Bic>;
typedef InstARM32ThreeAddrGPR<InstARM32::Eor> InstARM32Eor; using InstARM32Eor = InstARM32ThreeAddrGPR<InstARM32::Eor>;
typedef InstARM32ThreeAddrGPR<InstARM32::Lsl> InstARM32Lsl; using InstARM32Lsl = InstARM32ThreeAddrGPR<InstARM32::Lsl>;
typedef InstARM32ThreeAddrGPR<InstARM32::Lsr> InstARM32Lsr; using InstARM32Lsr = InstARM32ThreeAddrGPR<InstARM32::Lsr>;
typedef InstARM32ThreeAddrGPR<InstARM32::Mul> InstARM32Mul; using InstARM32Mul = InstARM32ThreeAddrGPR<InstARM32::Mul>;
typedef InstARM32ThreeAddrGPR<InstARM32::Orr> InstARM32Orr; using InstARM32Orr = InstARM32ThreeAddrGPR<InstARM32::Orr>;
typedef InstARM32ThreeAddrGPR<InstARM32::Rsb> InstARM32Rsb; using InstARM32Rsb = InstARM32ThreeAddrGPR<InstARM32::Rsb>;
typedef InstARM32ThreeAddrGPR<InstARM32::Sbc> InstARM32Sbc; using InstARM32Sbc = InstARM32ThreeAddrGPR<InstARM32::Sbc>;
typedef InstARM32ThreeAddrGPR<InstARM32::Sdiv> InstARM32Sdiv; using InstARM32Sdiv = InstARM32ThreeAddrGPR<InstARM32::Sdiv>;
typedef InstARM32ThreeAddrGPR<InstARM32::Sub> InstARM32Sub; using InstARM32Sub = InstARM32ThreeAddrGPR<InstARM32::Sub>;
typedef InstARM32ThreeAddrGPR<InstARM32::Udiv> InstARM32Udiv; using InstARM32Udiv = InstARM32ThreeAddrGPR<InstARM32::Udiv>;
typedef InstARM32ThreeAddrFP<InstARM32::Vadd> InstARM32Vadd; using InstARM32Vadd = InstARM32ThreeAddrFP<InstARM32::Vadd>;
typedef InstARM32ThreeAddrFP<InstARM32::Vdiv> InstARM32Vdiv; using InstARM32Vdiv = InstARM32ThreeAddrFP<InstARM32::Vdiv>;
typedef InstARM32ThreeAddrFP<InstARM32::Vmul> InstARM32Vmul; using InstARM32Vmul = InstARM32ThreeAddrFP<InstARM32::Vmul>;
typedef InstARM32ThreeAddrFP<InstARM32::Vsub> InstARM32Vsub; using InstARM32Vsub = InstARM32ThreeAddrFP<InstARM32::Vsub>;
typedef InstARM32Movlike<InstARM32::Ldr> InstARM32Ldr; using InstARM32Ldr = InstARM32Movlike<InstARM32::Ldr>;
/// Move instruction (variable <- flex). This is more of a pseudo-inst. /// Move instruction (variable <- flex). This is more of a pseudo-inst.
/// If var is a register, then we use "mov". If var is stack, then we use /// If var is a register, then we use "mov". If var is stack, then we use
/// "str" to store to the stack. /// "str" to store to the stack.
typedef InstARM32Movlike<InstARM32::Mov> InstARM32Mov; using InstARM32Mov = InstARM32Movlike<InstARM32::Mov>;
/// Represents various vector mov instruction forms (simple single source, /// Represents various vector mov instruction forms (simple single source,
/// single dest forms only, not the 2 GPR <-> 1 D reg forms, etc.). /// single dest forms only, not the 2 GPR <-> 1 D reg forms, etc.).
typedef InstARM32Movlike<InstARM32::Vmov> InstARM32Vmov; using InstARM32Vmov = InstARM32Movlike<InstARM32::Vmov>;
typedef InstARM32Movlike<InstARM32::Vldr> InstARM32Vldr; using InstARM32Vldr = InstARM32Movlike<InstARM32::Vldr>;
/// MovT leaves the bottom bits alone so dest is also a source. /// MovT leaves the bottom bits alone so dest is also a source.
/// This helps indicate that a previous MovW setting dest is not dead code. /// This helps indicate that a previous MovW setting dest is not dead code.
typedef InstARM32TwoAddrGPR<InstARM32::Movt> InstARM32Movt; using InstARM32Movt = InstARM32TwoAddrGPR<InstARM32::Movt>;
typedef InstARM32UnaryopGPR<InstARM32::Movw, false> InstARM32Movw; using InstARM32Movw = InstARM32UnaryopGPR<InstARM32::Movw, false>;
typedef InstARM32UnaryopGPR<InstARM32::Clz, false> InstARM32Clz; using InstARM32Clz = InstARM32UnaryopGPR<InstARM32::Clz, false>;
typedef InstARM32UnaryopGPR<InstARM32::Mvn, false> InstARM32Mvn; using InstARM32Mvn = InstARM32UnaryopGPR<InstARM32::Mvn, false>;
typedef InstARM32UnaryopGPR<InstARM32::Rbit, false> InstARM32Rbit; using InstARM32Rbit = InstARM32UnaryopGPR<InstARM32::Rbit, false>;
typedef InstARM32UnaryopGPR<InstARM32::Rev, false> InstARM32Rev; using InstARM32Rev = InstARM32UnaryopGPR<InstARM32::Rev, false>;
// Technically, the uxt{b,h} and sxt{b,h} instructions have a rotation // Technically, the uxt{b,h} and sxt{b,h} instructions have a rotation
// operand as well (rotate source by 8, 16, 24 bits prior to extending), // operand as well (rotate source by 8, 16, 24 bits prior to extending),
// but we aren't using that for now, so just model as a Unaryop. // but we aren't using that for now, so just model as a Unaryop.
typedef InstARM32UnaryopGPR<InstARM32::Sxt, true> InstARM32Sxt; using InstARM32Sxt = InstARM32UnaryopGPR<InstARM32::Sxt, true>;
typedef InstARM32UnaryopGPR<InstARM32::Uxt, true> InstARM32Uxt; using InstARM32Uxt = InstARM32UnaryopGPR<InstARM32::Uxt, true>;
typedef InstARM32UnaryopFP<InstARM32::Vsqrt> InstARM32Vsqrt; using InstARM32Vsqrt = InstARM32UnaryopFP<InstARM32::Vsqrt>;
typedef InstARM32FourAddrGPR<InstARM32::Mla> InstARM32Mla; using InstARM32Mla = InstARM32FourAddrGPR<InstARM32::Mla>;
typedef InstARM32FourAddrGPR<InstARM32::Mls> InstARM32Mls; using InstARM32Mls = InstARM32FourAddrGPR<InstARM32::Mls>;
typedef InstARM32CmpLike<InstARM32::Cmp> InstARM32Cmp; using InstARM32Cmp = InstARM32CmpLike<InstARM32::Cmp>;
typedef InstARM32CmpLike<InstARM32::Tst> InstARM32Tst; using InstARM32Tst = InstARM32CmpLike<InstARM32::Tst>;
// InstARM32Label represents an intra-block label that is the target // InstARM32Label represents an intra-block label that is the target
// of an intra-block branch. The offset between the label and the // of an intra-block branch. The offset between the label and the
......
...@@ -2496,7 +2496,7 @@ template <class Machine> class InstX86Nop final : public InstX86Base<Machine> { ...@@ -2496,7 +2496,7 @@ template <class Machine> class InstX86Nop final : public InstX86Base<Machine> {
public: public:
// TODO: Replace with enum. // TODO: Replace with enum.
typedef unsigned NopVariant; using NopVariant = unsigned;
static InstX86Nop *create(Cfg *Func, NopVariant Variant) { static InstX86Nop *create(Cfg *Func, NopVariant Variant) {
return new (Func->allocate<InstX86Nop>()) InstX86Nop(Func, Variant); return new (Func->allocate<InstX86Nop>()) InstX86Nop(Func, Variant);
......
...@@ -165,7 +165,7 @@ public: ...@@ -165,7 +165,7 @@ public:
private: private:
// TODO(jvoung): May want to switch to something like LLVM's StringMap. // TODO(jvoung): May want to switch to something like LLVM's StringMap.
typedef std::map<IceString, FullIntrinsicInfo> IntrinsicMap; using IntrinsicMap = std::map<IceString, FullIntrinsicInfo>;
IntrinsicMap Map; IntrinsicMap Map;
}; };
......
...@@ -159,7 +159,7 @@ class ConstantPrimitive : public Constant { ...@@ -159,7 +159,7 @@ class ConstantPrimitive : public Constant {
ConstantPrimitive &operator=(const ConstantPrimitive &) = delete; ConstantPrimitive &operator=(const ConstantPrimitive &) = delete;
public: public:
typedef T PrimType; using PrimType = T;
static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, PrimType Value, static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, PrimType Value,
uint32_t PoolEntryID) { uint32_t PoolEntryID) {
...@@ -192,10 +192,10 @@ private: ...@@ -192,10 +192,10 @@ private:
const PrimType Value; const PrimType Value;
}; };
typedef ConstantPrimitive<int32_t, Operand::kConstInteger32> ConstantInteger32; using ConstantInteger32 = ConstantPrimitive<int32_t, Operand::kConstInteger32>;
typedef ConstantPrimitive<int64_t, Operand::kConstInteger64> ConstantInteger64; using ConstantInteger64 = ConstantPrimitive<int64_t, Operand::kConstInteger64>;
typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat; using ConstantFloat = ConstantPrimitive<float, Operand::kConstFloat>;
typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble; using ConstantDouble = ConstantPrimitive<double, Operand::kConstDouble>;
template <> template <>
inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const { inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const {
...@@ -387,10 +387,10 @@ public: ...@@ -387,10 +387,10 @@ public:
void dump(Ostream &Str) const; void dump(Ostream &Str) const;
private: private:
typedef std::pair<InstNumberT, InstNumberT> RangeElementType; using RangeElementType = std::pair<InstNumberT, InstNumberT>;
/// RangeType is arena-allocated from the Cfg's allocator. /// RangeType is arena-allocated from the Cfg's allocator.
typedef std::vector<RangeElementType, CfgLocalAllocator<RangeElementType>> using RangeType =
RangeType; std::vector<RangeElementType, CfgLocalAllocator<RangeElementType>>;
RangeType Range; RangeType Range;
/// TrimmedBegin is an optimization for the overlaps() computation. /// TrimmedBegin is an optimization for the overlaps() computation.
/// Since the linear-scan algorithm always calls it as overlaps(Cur) /// Since the linear-scan algorithm always calls it as overlaps(Cur)
...@@ -560,7 +560,7 @@ enum MetadataKind { ...@@ -560,7 +560,7 @@ enum MetadataKind {
VMK_SingleDefs, /// Track uses+defs, but only record single def VMK_SingleDefs, /// Track uses+defs, but only record single def
VMK_All /// Track uses+defs, including full def list VMK_All /// Track uses+defs, including full def list
}; };
typedef std::vector<const Inst *, CfgLocalAllocator<const Inst *>> InstDefList; using InstDefList = std::vector<const Inst *, CfgLocalAllocator<const Inst *>>;
/// VariableTracking tracks the metadata for a single variable. It is /// VariableTracking tracks the metadata for a single variable. It is
/// only meant to be used internally by VariablesMetadata. /// only meant to be used internally by VariablesMetadata.
......
...@@ -39,8 +39,8 @@ public: ...@@ -39,8 +39,8 @@ public:
static constexpr size_t REGS_SIZE = 32; static constexpr size_t REGS_SIZE = 32;
private: private:
typedef std::vector<Variable *> OrderedRanges; using OrderedRanges = std::vector<Variable *>;
typedef std::vector<Variable *> UnorderedRanges; using UnorderedRanges = std::vector<Variable *>;
class IterationState { class IterationState {
IterationState(const IterationState &) = delete; IterationState(const IterationState &) = delete;
......
...@@ -20,8 +20,8 @@ namespace Ice { ...@@ -20,8 +20,8 @@ namespace Ice {
class CaseCluster; class CaseCluster;
typedef std::vector<CaseCluster, CfgLocalAllocator<CaseCluster>> using CaseClusterArray =
CaseClusterArray; std::vector<CaseCluster, CfgLocalAllocator<CaseCluster>>;
/// A cluster of cases can be tested by a common method during switch lowering. /// A cluster of cases can be tested by a common method during switch lowering.
class CaseCluster { class CaseCluster {
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
#include <pthread.h> #include <pthread.h>
#define ICE_TLS_DECLARE_FIELD(Type, FieldName) \ #define ICE_TLS_DECLARE_FIELD(Type, FieldName) \
typedef Type FieldName##__type; \ using FieldName##__type = Type; \
static pthread_key_t FieldName##__key; \ static pthread_key_t FieldName##__key; \
static int FieldName##__initStatus static int FieldName##__initStatus
#define ICE_TLS_DEFINE_FIELD(Type, ClassName, FieldName) \ #define ICE_TLS_DEFINE_FIELD(Type, ClassName, FieldName) \
......
...@@ -206,7 +206,7 @@ public: ...@@ -206,7 +206,7 @@ public:
RegSet_FramePointer = 1 << 3, RegSet_FramePointer = 1 << 3,
RegSet_All = ~RegSet_None RegSet_All = ~RegSet_None
}; };
typedef uint32_t RegSetMask; using RegSetMask = uint32_t;
virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include, virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include,
RegSetMask Exclude) const = 0; RegSetMask Exclude) const = 0;
......
...@@ -152,7 +152,7 @@ protected: ...@@ -152,7 +152,7 @@ protected:
Legal_Mem = 1 << 2, /// includes [r0, r1 lsl #2] as well as [sp, #12] Legal_Mem = 1 << 2, /// includes [r0, r1 lsl #2] as well as [sp, #12]
Legal_All = ~Legal_None Legal_All = ~Legal_None
}; };
typedef uint32_t LegalMask; using LegalMask = uint32_t;
Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, Operand *legalize(Operand *From, LegalMask Allowed = Legal_All,
int32_t RegNum = Variable::NoRegister); int32_t RegNum = Variable::NoRegister);
Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister); Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister);
...@@ -175,9 +175,9 @@ protected: ...@@ -175,9 +175,9 @@ protected:
// test; branch .LSKIP; trap; .LSKIP: <continuation>. // test; branch .LSKIP; trap; .LSKIP: <continuation>.
// If no check is needed nothing is inserted. // If no check is needed nothing is inserted.
void div0Check(Type Ty, Operand *SrcLo, Operand *SrcHi); void div0Check(Type Ty, Operand *SrcLo, Operand *SrcHi);
typedef void (TargetARM32::*ExtInstr)(Variable *, Variable *, using ExtInstr = void (TargetARM32::*)(Variable *, Variable *,
CondARM32::Cond); CondARM32::Cond);
typedef void (TargetARM32::*DivInstr)(Variable *, Variable *, Variable *, using DivInstr = void (TargetARM32::*)(Variable *, Variable *, Variable *,
CondARM32::Cond); CondARM32::Cond);
void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1, void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1,
ExtInstr ExtFunc, DivInstr DivFunc, ExtInstr ExtFunc, DivInstr DivFunc,
......
...@@ -120,7 +120,7 @@ void TargetX8632::lowerCall(const InstCall *Instr) { ...@@ -120,7 +120,7 @@ void TargetX8632::lowerCall(const InstCall *Instr) {
// Apple. // Apple.
NeedsStackAlignment = true; NeedsStackAlignment = true;
typedef std::vector<Operand *> OperandList; using OperandList = std::vector<Operand *>;
OperandList XmmArgs; OperandList XmmArgs;
OperandList StackArgs, StackArgLocations; OperandList StackArgs, StackArgLocations;
uint32_t ParameterAreaSizeBytes = 0; uint32_t ParameterAreaSizeBytes = 0;
...@@ -653,8 +653,8 @@ namespace { ...@@ -653,8 +653,8 @@ namespace {
template <typename T> struct PoolTypeConverter {}; template <typename T> struct PoolTypeConverter {};
template <> struct PoolTypeConverter<float> { template <> struct PoolTypeConverter<float> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantFloat IceType; using IceType = ConstantFloat;
static const Type Ty = IceType_f32; static const Type Ty = IceType_f32;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -665,8 +665,8 @@ const char *PoolTypeConverter<float>::AsmTag = ".long"; ...@@ -665,8 +665,8 @@ const char *PoolTypeConverter<float>::AsmTag = ".long";
const char *PoolTypeConverter<float>::PrintfString = "0x%x"; const char *PoolTypeConverter<float>::PrintfString = "0x%x";
template <> struct PoolTypeConverter<double> { template <> struct PoolTypeConverter<double> {
typedef uint64_t PrimitiveIntType; using PrimitiveIntType = uint64_t;
typedef ConstantDouble IceType; using IceType = ConstantDouble;
static const Type Ty = IceType_f64; static const Type Ty = IceType_f64;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -678,8 +678,8 @@ const char *PoolTypeConverter<double>::PrintfString = "0x%llx"; ...@@ -678,8 +678,8 @@ const char *PoolTypeConverter<double>::PrintfString = "0x%llx";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint32_t> { template <> struct PoolTypeConverter<uint32_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i32; static const Type Ty = IceType_i32;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -691,8 +691,8 @@ const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x"; ...@@ -691,8 +691,8 @@ const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint16_t> { template <> struct PoolTypeConverter<uint16_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i16; static const Type Ty = IceType_i16;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -704,8 +704,8 @@ const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x"; ...@@ -704,8 +704,8 @@ const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint8_t> { template <> struct PoolTypeConverter<uint8_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i8; static const Type Ty = IceType_i8;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
......
...@@ -396,8 +396,8 @@ template <> struct MachineTraits<TargetX8632> { ...@@ -396,8 +396,8 @@ template <> struct MachineTraits<TargetX8632> {
// class. For x86-32, this would comprise the 8 XMM registers. This is for // class. For x86-32, this would comprise the 8 XMM registers. This is for
// performance, not correctness. // performance, not correctness.
static const unsigned MaxEquivalenceClassSize = 8; static const unsigned MaxEquivalenceClassSize = 8;
typedef llvm::SmallVector<int32_t, MaxEquivalenceClassSize> RegisterList; using RegisterList = llvm::SmallVector<int32_t, MaxEquivalenceClassSize>;
typedef std::map<uint32_t, RegisterList> EquivalenceClassMap; using EquivalenceClassMap = std::map<uint32_t, RegisterList>;
EquivalenceClassMap EquivalenceClasses; EquivalenceClassMap EquivalenceClasses;
SizeT NumShuffled = 0, NumPreserved = 0; SizeT NumShuffled = 0, NumPreserved = 0;
......
...@@ -665,8 +665,8 @@ namespace { ...@@ -665,8 +665,8 @@ namespace {
template <typename T> struct PoolTypeConverter {}; template <typename T> struct PoolTypeConverter {};
template <> struct PoolTypeConverter<float> { template <> struct PoolTypeConverter<float> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantFloat IceType; using IceType = ConstantFloat;
static const Type Ty = IceType_f32; static const Type Ty = IceType_f32;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -677,8 +677,8 @@ const char *PoolTypeConverter<float>::AsmTag = ".long"; ...@@ -677,8 +677,8 @@ const char *PoolTypeConverter<float>::AsmTag = ".long";
const char *PoolTypeConverter<float>::PrintfString = "0x%x"; const char *PoolTypeConverter<float>::PrintfString = "0x%x";
template <> struct PoolTypeConverter<double> { template <> struct PoolTypeConverter<double> {
typedef uint64_t PrimitiveIntType; using PrimitiveIntType = uint64_t;
typedef ConstantDouble IceType; using IceType = ConstantDouble;
static const Type Ty = IceType_f64; static const Type Ty = IceType_f64;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -690,8 +690,8 @@ const char *PoolTypeConverter<double>::PrintfString = "0x%llx"; ...@@ -690,8 +690,8 @@ const char *PoolTypeConverter<double>::PrintfString = "0x%llx";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint32_t> { template <> struct PoolTypeConverter<uint32_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i32; static const Type Ty = IceType_i32;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -703,8 +703,8 @@ const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x"; ...@@ -703,8 +703,8 @@ const char *PoolTypeConverter<uint32_t>::PrintfString = "0x%x";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint16_t> { template <> struct PoolTypeConverter<uint16_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i16; static const Type Ty = IceType_i16;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
...@@ -716,8 +716,8 @@ const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x"; ...@@ -716,8 +716,8 @@ const char *PoolTypeConverter<uint16_t>::PrintfString = "0x%x";
// Add converter for int type constant pooling // Add converter for int type constant pooling
template <> struct PoolTypeConverter<uint8_t> { template <> struct PoolTypeConverter<uint8_t> {
typedef uint32_t PrimitiveIntType; using PrimitiveIntType = uint32_t;
typedef ConstantInteger32 IceType; using IceType = ConstantInteger32;
static const Type Ty = IceType_i8; static const Type Ty = IceType_i8;
static const char *TypeName; static const char *TypeName;
static const char *AsmTag; static const char *AsmTag;
......
...@@ -410,8 +410,8 @@ template <> struct MachineTraits<TargetX8664> { ...@@ -410,8 +410,8 @@ template <> struct MachineTraits<TargetX8664> {
// class. For x86-64, this would comprise the 16 XMM registers. This is // class. For x86-64, this would comprise the 16 XMM registers. This is
// for performance, not correctness. // for performance, not correctness.
static const unsigned MaxEquivalenceClassSize = 8; static const unsigned MaxEquivalenceClassSize = 8;
typedef llvm::SmallVector<int32_t, MaxEquivalenceClassSize> RegisterList; using RegisterList = llvm::SmallVector<int32_t, MaxEquivalenceClassSize>;
typedef std::map<uint32_t, RegisterList> EquivalenceClassMap; using EquivalenceClassMap = std::map<uint32_t, RegisterList>;
EquivalenceClassMap EquivalenceClasses; EquivalenceClassMap EquivalenceClasses;
SizeT NumShuffled = 0, NumPreserved = 0; SizeT NumShuffled = 0, NumPreserved = 0;
......
...@@ -229,7 +229,7 @@ protected: ...@@ -229,7 +229,7 @@ protected:
void lowerCaseCluster(const CaseCluster &Case, Operand *Src0, bool DoneCmp, void lowerCaseCluster(const CaseCluster &Case, Operand *Src0, bool DoneCmp,
CfgNode *DefaultLabel = nullptr); CfgNode *DefaultLabel = nullptr);
typedef void (TargetX86Base::*LowerBinOp)(Variable *, Operand *); using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *);
void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi,
Variable *Dest, Operand *Ptr, Operand *Val); Variable *Dest, Operand *Ptr, Operand *Val);
...@@ -252,7 +252,7 @@ protected: ...@@ -252,7 +252,7 @@ protected:
Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12]
Legal_All = ~Legal_None Legal_All = ~Legal_None
}; };
typedef uint32_t LegalMask; using LegalMask = uint32_t;
Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, Operand *legalize(Operand *From, LegalMask Allowed = Legal_All,
int32_t RegNum = Variable::NoRegister); int32_t RegNum = Variable::NoRegister);
Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister); Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister);
......
...@@ -220,7 +220,7 @@ void TimerStack::reset() { ...@@ -220,7 +220,7 @@ void TimerStack::reset() {
namespace { namespace {
typedef std::multimap<double, IceString> DumpMapType; using DumpMapType = std::multimap<double, IceString>;
// Dump the Map items in reverse order of their time contribution. // Dump the Map items in reverse order of their time contribution.
void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) { void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) {
......
...@@ -28,14 +28,14 @@ class TimerStack { ...@@ -28,14 +28,14 @@ class TimerStack {
/// Timer tree index type. A variable of this type is used to access /// Timer tree index type. A variable of this type is used to access
/// an interior, not-necessarily-leaf node of the tree. /// an interior, not-necessarily-leaf node of the tree.
typedef std::vector<class TimerTreeNode>::size_type TTindex; using TTindex = std::vector<class TimerTreeNode>::size_type;
/// Representation of a path of leaf values leading to a particular /// Representation of a path of leaf values leading to a particular
/// node. The representation happens to be in "reverse" order, /// node. The representation happens to be in "reverse" order,
/// i.e. from leaf/interior to root, for implementation efficiency. /// i.e. from leaf/interior to root, for implementation efficiency.
typedef llvm::SmallVector<TTindex, 8> PathType; using PathType = llvm::SmallVector<TTindex, 8>;
/// Representation of a mapping of leaf node indexes from one timer /// Representation of a mapping of leaf node indexes from one timer
/// stack to another. /// stack to another.
typedef std::vector<TimerIdT> TranslationType; using TranslationType = std::vector<TimerIdT>;
/// TimerTreeNode represents an interior or leaf node in the call tree. /// TimerTreeNode represents an interior or leaf node in the call tree.
/// It contains a list of children, a pointer to its parent, and the /// It contains a list of children, a pointer to its parent, and the
......
...@@ -129,7 +129,7 @@ class FuncSigType { ...@@ -129,7 +129,7 @@ class FuncSigType {
FuncSigType &operator=(const FuncSigType &Ty) = delete; FuncSigType &operator=(const FuncSigType &Ty) = delete;
public: public:
typedef std::vector<Type> ArgListType; using ArgListType = std::vector<Type>;
/// Creates a function signature type with the given return type. /// Creates a function signature type with the given return type.
/// Parameter types should be added using calls to appendArgType. /// Parameter types should be added using calls to appendArgType.
......
...@@ -945,8 +945,8 @@ public: ...@@ -945,8 +945,8 @@ public:
const char *getBlockName() const override { return "globals"; } const char *getBlockName() const override { return "globals"; }
private: private:
typedef std::unordered_map<NaClBcIndexSize_t, Ice::VariableDeclaration *> using GlobalVarsMapType =
GlobalVarsMapType; std::unordered_map<NaClBcIndexSize_t, Ice::VariableDeclaration *>;
Ice::TimerMarker Timer; Ice::TimerMarker Timer;
...@@ -1158,7 +1158,7 @@ public: ...@@ -1158,7 +1158,7 @@ public:
const char *getBlockName() const override { return "valuesymtab"; } const char *getBlockName() const override { return "valuesymtab"; }
protected: protected:
typedef SmallString<128> StringType; using StringType = SmallString<128>;
// Associates Name with the value defined by the given Index. // Associates Name with the value defined by the given Index.
virtual void setValueName(NaClBcIndexSize_t Index, StringType &Name) = 0; virtual void setValueName(NaClBcIndexSize_t Index, StringType &Name) = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment