diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h index bc0265904ef65..fffcbd9f3c1d8 100644 --- a/llvm/include/llvm/Support/Allocator.h +++ b/llvm/include/llvm/Support/Allocator.h @@ -380,7 +380,7 @@ class BumpPtrAllocatorImpl /// The standard BumpPtrAllocator which just uses the default template /// parameters. -typedef BumpPtrAllocatorImpl<> BumpPtrAllocator; +using BumpPtrAllocator = BumpPtrAllocatorImpl<>; /// A BumpPtrAllocator that allows only elements of a specific type to be /// allocated. diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h index c2d9ae2da231c..3c62672a077f1 100644 --- a/llvm/include/llvm/Support/Atomic.h +++ b/llvm/include/llvm/Support/Atomic.h @@ -30,9 +30,9 @@ namespace llvm { LLVM_ABI void MemoryFence(); #ifdef _MSC_VER - typedef long cas_flag; + using cas_flag = long; #else - typedef uint32_t cas_flag; + using cas_flag = uint32_t; #endif LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag *ptr, cas_flag new_value, cas_flag old_value); diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h index ef2233c53ec2c..a7d03f6511f12 100644 --- a/llvm/include/llvm/Support/BinaryStreamArray.h +++ b/llvm/include/llvm/Support/BinaryStreamArray.h @@ -93,7 +93,7 @@ class VarStreamArray { friend class VarStreamArrayIterator; public: - typedef VarStreamArrayIterator Iterator; + using Iterator = VarStreamArrayIterator; VarStreamArray() = default; @@ -156,8 +156,8 @@ template class VarStreamArrayIterator : public iterator_facade_base, std::forward_iterator_tag, const ValueType> { - typedef VarStreamArrayIterator IterType; - typedef VarStreamArray ArrayType; + using IterType = VarStreamArrayIterator; + using ArrayType = VarStreamArray; public: VarStreamArrayIterator(const ArrayType &Array, const Extractor &E, @@ -260,7 +260,7 @@ template class FixedStreamArray { friend class FixedStreamArrayIterator; public: - typedef FixedStreamArrayIterator Iterator; + using Iterator = FixedStreamArrayIterator; FixedStreamArray() = default; explicit FixedStreamArray(BinaryStreamRef Stream) : Stream(Stream) { diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h index 5b8102d8e11cf..e5f98249cc074 100644 --- a/llvm/include/llvm/Support/Chrono.h +++ b/llvm/include/llvm/Support/Chrono.h @@ -150,10 +150,10 @@ template <> struct unit { template struct format_provider> { private: - typedef std::chrono::duration Dur; - typedef std::conditional_t::value, - double, intmax_t> - InternalRep; + using Dur = std::chrono::duration; + using InternalRep = + std::conditional_t::value, + double, intmax_t>; template static InternalRep getAs(const Dur &D) { using namespace std::chrono; diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h index bb1723518a490..ddf7057bff59d 100644 --- a/llvm/include/llvm/Support/ConvertUTF.h +++ b/llvm/include/llvm/Support/ConvertUTF.h @@ -126,10 +126,10 @@ namespace llvm { bit mask & shift operations. ------------------------------------------------------------------------ */ -typedef unsigned int UTF32; /* at least 32 bits */ -typedef unsigned short UTF16; /* at least 16 bits */ -typedef unsigned char UTF8; /* typically 8 bits */ -typedef unsigned char Boolean; /* 0 or 1 */ +using UTF32 = unsigned int; /* at least 32 bits */ +using UTF16 = unsigned short; /* at least 16 bits */ +using UTF8 = unsigned char; /* typically 8 bits */ +using Boolean = unsigned char; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD @@ -146,17 +146,14 @@ typedef unsigned char Boolean; /* 0 or 1 */ #define UNI_UTF32_BYTE_ORDER_MARK_NATIVE 0x0000FEFF #define UNI_UTF32_BYTE_ORDER_MARK_SWAPPED 0xFFFE0000 -typedef enum { - conversionOK, /* conversion successful */ - sourceExhausted, /* partial character in source, but hit end */ - targetExhausted, /* insuff. room in target for conversion */ - sourceIllegal /* source sequence is illegal/malformed */ -} ConversionResult; - -typedef enum { - strictConversion = 0, - lenientConversion -} ConversionFlags; +enum ConversionResult { + conversionOK, /* conversion successful */ + sourceExhausted, /* partial character in source, but hit end */ + targetExhausted, /* insuff. room in target for conversion */ + sourceIllegal /* source sequence is illegal/malformed */ +}; + +enum ConversionFlags { strictConversion = 0, lenientConversion }; LLVM_ABI ConversionResult ConvertUTF8toUTF16(const UTF8 **sourceStart, const UTF8 *sourceEnd, diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h index 39a08d499b67e..9904a0dd86559 100644 --- a/llvm/include/llvm/Support/DebugCounter.h +++ b/llvm/include/llvm/Support/DebugCounter.h @@ -140,7 +140,7 @@ class DebugCounter { } // Iterate through the registered counters - typedef UniqueVector CounterVector; + using CounterVector = UniqueVector; CounterVector::const_iterator begin() const { return RegisteredCounters.begin(); } diff --git a/llvm/include/llvm/Support/ErrorHandling.h b/llvm/include/llvm/Support/ErrorHandling.h index 4c17b6e83acd2..a4fd008a9ff3f 100644 --- a/llvm/include/llvm/Support/ErrorHandling.h +++ b/llvm/include/llvm/Support/ErrorHandling.h @@ -21,8 +21,8 @@ class StringRef; class Twine; /// An error handler callback. -typedef void (*fatal_error_handler_t)(void *user_data, const char *reason, - bool gen_crash_diag); +using fatal_error_handler_t = void (*)(void *user_data, const char *reason, + bool gen_crash_diag); /// install_fatal_error_handler - Installs a new error handler to be used /// whenever a serious (non-recoverable) error is encountered by LLVM. diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h index 0fdc7b6f94da7..c0b245e297a58 100644 --- a/llvm/include/llvm/Support/FormatVariadicDetails.h +++ b/llvm/include/llvm/Support/FormatVariadicDetails.h @@ -63,8 +63,8 @@ template class missing_format_adapter; template class has_FormatProvider { public: using Decayed = std::decay_t; - typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &, - StringRef); + using Signature_format = void (*)(const Decayed &, llvm::raw_ostream &, + StringRef); template using check = SameType; diff --git a/llvm/include/llvm/Support/GenericLoopInfo.h b/llvm/include/llvm/Support/GenericLoopInfo.h index b6bb360d9868f..9e2f61fd03e78 100644 --- a/llvm/include/llvm/Support/GenericLoopInfo.h +++ b/llvm/include/llvm/Support/GenericLoopInfo.h @@ -150,9 +150,9 @@ template class LoopBase { assert(!isInvalid() && "Loop not in a valid state!"); return SubLoops; } - typedef typename std::vector::const_iterator iterator; - typedef - typename std::vector::const_reverse_iterator reverse_iterator; + using iterator = typename std::vector::const_iterator; + using reverse_iterator = + typename std::vector::const_reverse_iterator; iterator begin() const { return getSubLoops().begin(); } iterator end() const { return getSubLoops().end(); } reverse_iterator rbegin() const { return getSubLoops().rbegin(); } @@ -174,7 +174,7 @@ template class LoopBase { assert(!isInvalid() && "Loop not in a valid state!"); return Blocks; } - typedef typename ArrayRef::const_iterator block_iterator; + using block_iterator = typename ArrayRef::const_iterator; block_iterator block_begin() const { return getBlocks().begin(); } block_iterator block_end() const { return getBlocks().end(); } inline iterator_range blocks() const { @@ -302,7 +302,7 @@ template class LoopBase { bool hasNoExitBlocks() const; /// Edge type. - typedef std::pair Edge; + using Edge = std::pair; /// Return all pairs of (_inside_block_,_outside_block_). void getExitEdges(SmallVectorImpl &ExitEdges) const; @@ -575,9 +575,9 @@ template class LoopInfoBase { /// iterator/begin/end - The interface to the top-level loops in the current /// function. /// - typedef typename std::vector::const_iterator iterator; - typedef - typename std::vector::const_reverse_iterator reverse_iterator; + using iterator = typename std::vector::const_iterator; + using reverse_iterator = + typename std::vector::const_reverse_iterator; iterator begin() const { return TopLevelLoops.begin(); } iterator end() const { return TopLevelLoops.end(); } reverse_iterator rbegin() const { return TopLevelLoops.rbegin(); } diff --git a/llvm/include/llvm/Support/GenericLoopInfoImpl.h b/llvm/include/llvm/Support/GenericLoopInfoImpl.h index 541678001a8ff..c830f0a67a448 100644 --- a/llvm/include/llvm/Support/GenericLoopInfoImpl.h +++ b/llvm/include/llvm/Support/GenericLoopInfoImpl.h @@ -459,7 +459,7 @@ template static void discoverAndMapSubloop(LoopT *L, ArrayRef Backedges, LoopInfoBase *LI, const DomTreeBase &DomTree) { - typedef GraphTraits> InvBlockTraits; + using InvBlockTraits = GraphTraits>; unsigned NumBlocks = 0; unsigned NumSubloops = 0; @@ -513,8 +513,8 @@ static void discoverAndMapSubloop(LoopT *L, ArrayRef Backedges, /// Populate all loop data in a stable order during a single forward DFS. template class PopulateLoopsDFS { - typedef GraphTraits BlockTraits; - typedef typename BlockTraits::ChildIteratorType SuccIterTy; + using BlockTraits = GraphTraits; + using SuccIterTy = typename BlockTraits::ChildIteratorType; LoopInfoBase *LI; diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h index 4ba386753f397..dbcb66d7680e4 100644 --- a/llvm/include/llvm/Support/MD5.h +++ b/llvm/include/llvm/Support/MD5.h @@ -90,7 +90,7 @@ class MD5 { private: // Any 32-bit or wider unsigned integer data type will do. - typedef uint32_t MD5_u32plus; + using MD5_u32plus = uint32_t; // Internal State struct { diff --git a/llvm/include/llvm/Support/Mutex.h b/llvm/include/llvm/Support/Mutex.h index d61e3fd96efbe..3ca5c9a2f6be8 100644 --- a/llvm/include/llvm/Support/Mutex.h +++ b/llvm/include/llvm/Support/Mutex.h @@ -63,12 +63,12 @@ namespace llvm }; /// Mutex - A standard, always enforced mutex. - typedef SmartMutex Mutex; + using Mutex = SmartMutex; template using SmartScopedLock = std::lock_guard>; - typedef SmartScopedLock ScopedLock; + using ScopedLock = SmartScopedLock; } } diff --git a/llvm/include/llvm/Support/OnDiskHashTable.h b/llvm/include/llvm/Support/OnDiskHashTable.h index d7d72cfbbc649..54c6b713478b9 100644 --- a/llvm/include/llvm/Support/OnDiskHashTable.h +++ b/llvm/include/llvm/Support/OnDiskHashTable.h @@ -69,7 +69,7 @@ template class OnDiskChainedHashTableGenerator { : Key(Key), Data(Data), Next(nullptr), Hash(InfoObj.ComputeHash(Key)) {} }; - typedef typename Info::offset_type offset_type; + using offset_type = typename Info::offset_type; offset_type NumBuckets; offset_type NumEntries; llvm::SpecificBumpPtrAllocator BA; @@ -278,12 +278,12 @@ template class OnDiskChainedHashTable { Info InfoObj; public: - typedef Info InfoType; - typedef typename Info::internal_key_type internal_key_type; - typedef typename Info::external_key_type external_key_type; - typedef typename Info::data_type data_type; - typedef typename Info::hash_value_type hash_value_type; - typedef typename Info::offset_type offset_type; + using InfoType = Info; + using internal_key_type = typename Info::internal_key_type; + using external_key_type = typename Info::external_key_type; + using data_type = typename Info::data_type; + using hash_value_type = typename Info::hash_value_type; + using offset_type = typename Info::offset_type; OnDiskChainedHashTable(offset_type NumBuckets, offset_type NumEntries, const unsigned char *Buckets, @@ -435,12 +435,12 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable { const unsigned char *Payload; public: - typedef OnDiskChainedHashTable base_type; - typedef typename base_type::internal_key_type internal_key_type; - typedef typename base_type::external_key_type external_key_type; - typedef typename base_type::data_type data_type; - typedef typename base_type::hash_value_type hash_value_type; - typedef typename base_type::offset_type offset_type; + using base_type = OnDiskChainedHashTable; + using internal_key_type = typename base_type::internal_key_type; + using external_key_type = typename base_type::external_key_type; + using data_type = typename base_type::data_type; + using hash_value_type = typename base_type::hash_value_type; + using offset_type = typename base_type::offset_type; private: /// Iterates over all of the keys in the table. @@ -450,7 +450,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable { offset_type NumEntriesLeft; public: - typedef external_key_type value_type; + using value_type = external_key_type; iterator_base(const unsigned char *const Ptr, offset_type NumEntries) : Ptr(Ptr), NumItemsInBucketLeft(0), NumEntriesLeft(NumEntries) {} @@ -505,7 +505,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable { Info *InfoObj; public: - typedef external_key_type value_type; + using value_type = external_key_type; key_iterator(const unsigned char *const Ptr, offset_type NumEntries, Info *InfoObj) @@ -551,7 +551,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable { Info *InfoObj; public: - typedef data_type value_type; + using value_type = data_type; data_iterator(const unsigned char *const Ptr, offset_type NumEntries, Info *InfoObj) diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h index 320f6b63b447e..a47d68406acf3 100644 --- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h +++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h @@ -70,7 +70,7 @@ template <> struct PointerLikeTypeTraits { // Provide PointerLikeTypeTraits for const things. template struct PointerLikeTypeTraits { - typedef PointerLikeTypeTraits NonConst; + using NonConst = PointerLikeTypeTraits; static inline const void *getAsVoidPointer(const T P) { return NonConst::getAsVoidPointer(P); @@ -83,7 +83,7 @@ template struct PointerLikeTypeTraits { // Provide PointerLikeTypeTraits for const pointers. template struct PointerLikeTypeTraits { - typedef PointerLikeTypeTraits NonConst; + using NonConst = PointerLikeTypeTraits; static inline const void *getAsVoidPointer(const T *P) { return NonConst::getAsVoidPointer(const_cast(P)); diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h index 53c2e7597b2b4..575e416587ea8 100644 --- a/llvm/include/llvm/Support/Program.h +++ b/llvm/include/llvm/Support/Program.h @@ -39,8 +39,8 @@ const char EnvPathSeparator = ';'; typedef unsigned long procid_t; // Must match the type of DWORD on Windows. typedef void *process_t; // Must match the type of HANDLE on Windows. #else -typedef ::pid_t procid_t; -typedef procid_t process_t; +using procid_t = ::pid_t; +using process_t = procid_t; #endif /// This struct encapsulates information about a process. diff --git a/llvm/include/llvm/Support/RISCVISAUtils.h b/llvm/include/llvm/Support/RISCVISAUtils.h index 165bb08d66431..05fd32e0e7cfe 100644 --- a/llvm/include/llvm/Support/RISCVISAUtils.h +++ b/llvm/include/llvm/Support/RISCVISAUtils.h @@ -40,8 +40,8 @@ struct ExtensionComparator { /// OrderedExtensionMap is std::map, it's specialized to keep entries /// in canonical order of extension. -typedef std::map - OrderedExtensionMap; +using OrderedExtensionMap = + std::map; } // namespace RISCVISAUtils diff --git a/llvm/include/llvm/Support/RWMutex.h b/llvm/include/llvm/Support/RWMutex.h index 8d221aaab9ab9..efc1ca19a1208 100644 --- a/llvm/include/llvm/Support/RWMutex.h +++ b/llvm/include/llvm/Support/RWMutex.h @@ -162,7 +162,7 @@ template class SmartRWMutex { bool try_lock() { return impl.try_lock(); } }; -typedef SmartRWMutex RWMutex; +using RWMutex = SmartRWMutex; /// ScopedReader - RAII acquisition of a reader lock #if !defined(LLVM_USE_RW_MUTEX_IMPL) @@ -179,7 +179,7 @@ template struct SmartScopedReader { ~SmartScopedReader() { mutex.unlock_shared(); } }; #endif -typedef SmartScopedReader ScopedReader; +using ScopedReader = SmartScopedReader; /// ScopedWriter - RAII acquisition of a writer lock #if !defined(LLVM_USE_RW_MUTEX_IMPL) @@ -196,7 +196,7 @@ template struct SmartScopedWriter { ~SmartScopedWriter() { mutex.unlock(); } }; #endif -typedef SmartScopedWriter ScopedWriter; +using ScopedWriter = SmartScopedWriter; } // end namespace sys } // end namespace llvm diff --git a/llvm/include/llvm/Support/Registry.h b/llvm/include/llvm/Support/Registry.h index c02f15e5e32b8..acd3b06fde6e7 100644 --- a/llvm/include/llvm/Support/Registry.h +++ b/llvm/include/llvm/Support/Registry.h @@ -43,8 +43,8 @@ namespace llvm { template class Registry { public: - typedef T type; - typedef SimpleRegistryEntry entry; + using type = T; + using entry = SimpleRegistryEntry; class node; class iterator; diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h index 07baf153e10c6..8ca8d457e339e 100644 --- a/llvm/include/llvm/Support/ScaledNumber.h +++ b/llvm/include/llvm/Support/ScaledNumber.h @@ -498,10 +498,10 @@ template class ScaledNumber : ScaledNumberBase { static_assert(!std::numeric_limits::is_signed, "only unsigned floats supported"); - typedef DigitsT DigitsType; + using DigitsType = DigitsT; private: - typedef std::numeric_limits DigitsLimits; + using DigitsLimits = std::numeric_limits; static constexpr int Width = sizeof(DigitsType) * 8; static_assert(Width <= 64, "invalid integer width for digits"); @@ -782,7 +782,7 @@ uint64_t ScaledNumber::scale(uint64_t N) const { template template IntT ScaledNumber::toInt() const { - typedef std::numeric_limits Limits; + using Limits = std::numeric_limits; if (*this < 1) return 0; if (*this >= Limits::max()) diff --git a/llvm/include/llvm/Support/SuffixTree.h b/llvm/include/llvm/Support/SuffixTree.h index 4c78235abf508..eac66d84d6f63 100644 --- a/llvm/include/llvm/Support/SuffixTree.h +++ b/llvm/include/llvm/Support/SuffixTree.h @@ -219,7 +219,7 @@ class SuffixTree { } }; - typedef RepeatedSubstringIterator iterator; + using iterator = RepeatedSubstringIterator; iterator begin() { return iterator(Root, LeafNodes); } iterator end() { return iterator(nullptr); } }; diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h index 88846807f111a..89d90b3438e92 100644 --- a/llvm/include/llvm/Support/Threading.h +++ b/llvm/include/llvm/Support/Threading.h @@ -53,7 +53,7 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; } #if LLVM_THREADING_USE_STD_CALL_ONCE - typedef std::once_flag once_flag; +using once_flag = std::once_flag; #else diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h index c47976524dcd9..218c2e336d77b 100644 --- a/llvm/include/llvm/Support/TrailingObjects.h +++ b/llvm/include/llvm/Support/TrailingObjects.h @@ -76,7 +76,7 @@ class TrailingObjectsBase { // number of a different type. e.g.: // ExtractSecondType::type template struct ExtractSecondType { - typedef Ty2 type; + using type = Ty2; }; // TrailingObjectsImpl is somewhat complicated, because it is a @@ -101,8 +101,8 @@ class TrailingObjectsImpl { - typedef TrailingObjectsImpl - ParentType; + using ParentType = + TrailingObjectsImpl; struct RequiresRealignment { static const bool value = alignof(PrevTy) < alignof(NextTy); diff --git a/llvm/include/llvm/Support/UnicodeCharRanges.h b/llvm/include/llvm/Support/UnicodeCharRanges.h index 7f1a9b3ff0c3b..2b5fc83d34690 100644 --- a/llvm/include/llvm/Support/UnicodeCharRanges.h +++ b/llvm/include/llvm/Support/UnicodeCharRanges.h @@ -37,7 +37,7 @@ inline bool operator<(UnicodeCharRange Range, uint32_t Value) { /// array. class UnicodeCharSet { public: - typedef ArrayRef CharRanges; + using CharRanges = ArrayRef; /// Constructs a UnicodeCharSet instance from an array of /// UnicodeCharRanges. diff --git a/llvm/include/llvm/Support/float128.h b/llvm/include/llvm/Support/float128.h index e15a98dc5a677..ffad1241c3e3d 100644 --- a/llvm/include/llvm/Support/float128.h +++ b/llvm/include/llvm/Support/float128.h @@ -14,7 +14,7 @@ namespace llvm { #if defined(__clang__) && defined(__FLOAT128__) && \ defined(__SIZEOF_INT128__) && !defined(__LONG_DOUBLE_IBM128__) #define HAS_IEE754_FLOAT128 -typedef __float128 float128; +using float128 = __float128; #elif defined(__FLOAT128__) && defined(__SIZEOF_INT128__) && \ !defined(__LONG_DOUBLE_IBM128__) && \ (defined(__GNUC__) || defined(__GNUG__)) diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h index 16e322bfd8785..ecde62d8368e7 100644 --- a/llvm/include/llvm/Support/thread.h +++ b/llvm/include/llvm/Support/thread.h @@ -127,7 +127,7 @@ LLVM_ABI thread::id llvm_thread_get_current_id_impl(); template thread::thread(std::optional StackSizeInBytes, Function &&f, Args &&...args) { - typedef std::tuple, std::decay_t...> CalleeTuple; + using CalleeTuple = std::tuple, std::decay_t...>; std::unique_ptr Callee( new CalleeTuple(std::forward(f), std::forward(args)...)); diff --git a/llvm/lib/Support/BalancedPartitioning.cpp b/llvm/lib/Support/BalancedPartitioning.cpp index 1914f4cc39d96..d859abddbcad8 100644 --- a/llvm/lib/Support/BalancedPartitioning.cpp +++ b/llvm/lib/Support/BalancedPartitioning.cpp @@ -231,7 +231,7 @@ unsigned BalancedPartitioning::runIteration(const FunctionNodeRange Nodes, } // Compute move gains - typedef std::pair GainPair; + using GainPair = std::pair; std::vector Gains; for (auto &N : Nodes) { bool FromLeftToRight = (N.Bucket == LeftBucket); diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index de5bd795403dc..dab8beeff7ca5 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -2343,10 +2343,10 @@ namespace { class HelpPrinter { protected: const bool ShowHidden; - typedef SmallVector, 128> - StrOptionPairVector; - typedef SmallVector, 128> - StrSubCommandPairVector; + using StrOptionPairVector = + SmallVector, 128>; + using StrSubCommandPairVector = + SmallVector, 128>; // Print the options. Opts is assumed to be alphabetically sorted. virtual void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) { for (const auto &Opt : Opts) diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp index 981536473d124..3bfae147d18c0 100644 --- a/llvm/lib/Support/DAGDeltaAlgorithm.cpp +++ b/llvm/lib/Support/DAGDeltaAlgorithm.cpp @@ -47,16 +47,16 @@ class DAGDeltaAlgorithmImpl { friend class DeltaActiveSetHelper; public: - typedef DAGDeltaAlgorithm::change_ty change_ty; - typedef DAGDeltaAlgorithm::changeset_ty changeset_ty; - typedef DAGDeltaAlgorithm::changesetlist_ty changesetlist_ty; - typedef DAGDeltaAlgorithm::edge_ty edge_ty; + using change_ty = DAGDeltaAlgorithm::change_ty; + using changeset_ty = DAGDeltaAlgorithm::changeset_ty; + using changesetlist_ty = DAGDeltaAlgorithm::changesetlist_ty; + using edge_ty = DAGDeltaAlgorithm::edge_ty; private: - typedef std::vector::iterator pred_iterator_ty; - typedef std::vector::iterator succ_iterator_ty; - typedef std::set::iterator pred_closure_iterator_ty; - typedef std::set::iterator succ_closure_iterator_ty; + using pred_iterator_ty = std::vector::iterator; + using succ_iterator_ty = std::vector::iterator; + using pred_closure_iterator_ty = std::set::iterator; + using succ_closure_iterator_ty = std::set::iterator; DAGDeltaAlgorithm &DDA; diff --git a/llvm/lib/Support/DynamicLibrary.cpp b/llvm/lib/Support/DynamicLibrary.cpp index f1c15c00cedea..61566d3722419 100644 --- a/llvm/lib/Support/DynamicLibrary.cpp +++ b/llvm/lib/Support/DynamicLibrary.cpp @@ -23,7 +23,7 @@ using namespace llvm::sys; // All methods for HandleSet should be used holding SymbolsMutex. class DynamicLibrary::HandleSet { - typedef std::vector HandleList; + using HandleList = std::vector; HandleList Handles; void *Process = &Invalid; diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 9d45096dddd97..b08f5083e00a8 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -207,7 +207,7 @@ void TimeRecord::print(const TimeRecord &Total, raw_ostream &OS) const { namespace { -typedef StringMap Name2TimerMap; +using Name2TimerMap = StringMap; class Name2PairMap { StringMap > Map;