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
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions llvm/include/llvm/Support/BinaryStreamArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class VarStreamArray {
friend class VarStreamArrayIterator<ValueType, Extractor>;

public:
typedef VarStreamArrayIterator<ValueType, Extractor> Iterator;
using Iterator = VarStreamArrayIterator<ValueType, Extractor>;

VarStreamArray() = default;

Expand Down Expand Up @@ -156,8 +156,8 @@ template <typename ValueType, typename Extractor>
class VarStreamArrayIterator
: public iterator_facade_base<VarStreamArrayIterator<ValueType, Extractor>,
std::forward_iterator_tag, const ValueType> {
typedef VarStreamArrayIterator<ValueType, Extractor> IterType;
typedef VarStreamArray<ValueType, Extractor> ArrayType;
using IterType = VarStreamArrayIterator<ValueType, Extractor>;
using ArrayType = VarStreamArray<ValueType, Extractor>;

public:
VarStreamArrayIterator(const ArrayType &Array, const Extractor &E,
Expand Down Expand Up @@ -260,7 +260,7 @@ template <typename T> class FixedStreamArray {
friend class FixedStreamArrayIterator<T>;

public:
typedef FixedStreamArrayIterator<T> Iterator;
using Iterator = FixedStreamArrayIterator<T>;

FixedStreamArray() = default;
explicit FixedStreamArray(BinaryStreamRef Stream) : Stream(Stream) {
Expand Down
8 changes: 4 additions & 4 deletions llvm/include/llvm/Support/Chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ template <> struct unit<std::nano> {
template <typename Rep, typename Period>
struct format_provider<std::chrono::duration<Rep, Period>> {
private:
typedef std::chrono::duration<Rep, Period> Dur;
typedef std::conditional_t<std::chrono::treat_as_floating_point<Rep>::value,
double, intmax_t>
InternalRep;
using Dur = std::chrono::duration<Rep, Period>;
using InternalRep =
std::conditional_t<std::chrono::treat_as_floating_point<Rep>::value,
double, intmax_t>;

template <typename AsPeriod> static InternalRep getAs(const Dur &D) {
using namespace std::chrono;
Expand Down
27 changes: 12 additions & 15 deletions llvm/include/llvm/Support/ConvertUTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/DebugCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class DebugCounter {
}

// Iterate through the registered counters
typedef UniqueVector<std::string> CounterVector;
using CounterVector = UniqueVector<std::string>;
CounterVector::const_iterator begin() const {
return RegisteredCounters.begin();
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/ErrorHandling.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/FormatVariadicDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ template <typename T> class missing_format_adapter;
template <class T> class has_FormatProvider {
public:
using Decayed = std::decay_t<T>;
typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &,
StringRef);
using Signature_format = void (*)(const Decayed &, llvm::raw_ostream &,
StringRef);

template <typename U> using check = SameType<Signature_format, &U::format>;

Expand Down
16 changes: 8 additions & 8 deletions llvm/include/llvm/Support/GenericLoopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ template <class BlockT, class LoopT> class LoopBase {
assert(!isInvalid() && "Loop not in a valid state!");
return SubLoops;
}
typedef typename std::vector<LoopT *>::const_iterator iterator;
typedef
typename std::vector<LoopT *>::const_reverse_iterator reverse_iterator;
using iterator = typename std::vector<LoopT *>::const_iterator;
using reverse_iterator =
typename std::vector<LoopT *>::const_reverse_iterator;
iterator begin() const { return getSubLoops().begin(); }
iterator end() const { return getSubLoops().end(); }
reverse_iterator rbegin() const { return getSubLoops().rbegin(); }
Expand All @@ -174,7 +174,7 @@ template <class BlockT, class LoopT> class LoopBase {
assert(!isInvalid() && "Loop not in a valid state!");
return Blocks;
}
typedef typename ArrayRef<BlockT *>::const_iterator block_iterator;
using block_iterator = typename ArrayRef<BlockT *>::const_iterator;
block_iterator block_begin() const { return getBlocks().begin(); }
block_iterator block_end() const { return getBlocks().end(); }
inline iterator_range<block_iterator> blocks() const {
Expand Down Expand Up @@ -302,7 +302,7 @@ template <class BlockT, class LoopT> class LoopBase {
bool hasNoExitBlocks() const;

/// Edge type.
typedef std::pair<BlockT *, BlockT *> Edge;
using Edge = std::pair<BlockT *, BlockT *>;

/// Return all pairs of (_inside_block_,_outside_block_).
void getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const;
Expand Down Expand Up @@ -575,9 +575,9 @@ template <class BlockT, class LoopT> class LoopInfoBase {
/// iterator/begin/end - The interface to the top-level loops in the current
/// function.
///
typedef typename std::vector<LoopT *>::const_iterator iterator;
typedef
typename std::vector<LoopT *>::const_reverse_iterator reverse_iterator;
using iterator = typename std::vector<LoopT *>::const_iterator;
using reverse_iterator =
typename std::vector<LoopT *>::const_reverse_iterator;
iterator begin() const { return TopLevelLoops.begin(); }
iterator end() const { return TopLevelLoops.end(); }
reverse_iterator rbegin() const { return TopLevelLoops.rbegin(); }
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Support/GenericLoopInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ template <class BlockT, class LoopT>
static void discoverAndMapSubloop(LoopT *L, ArrayRef<BlockT *> Backedges,
LoopInfoBase<BlockT, LoopT> *LI,
const DomTreeBase<BlockT> &DomTree) {
typedef GraphTraits<Inverse<BlockT *>> InvBlockTraits;
using InvBlockTraits = GraphTraits<Inverse<BlockT *>>;

unsigned NumBlocks = 0;
unsigned NumSubloops = 0;
Expand Down Expand Up @@ -513,8 +513,8 @@ static void discoverAndMapSubloop(LoopT *L, ArrayRef<BlockT *> Backedges,

/// Populate all loop data in a stable order during a single forward DFS.
template <class BlockT, class LoopT> class PopulateLoopsDFS {
typedef GraphTraits<BlockT *> BlockTraits;
typedef typename BlockTraits::ChildIteratorType SuccIterTy;
using BlockTraits = GraphTraits<BlockT *>;
using SuccIterTy = typename BlockTraits::ChildIteratorType;

LoopInfoBase<BlockT, LoopT> *LI;

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/MD5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ namespace llvm
};

/// Mutex - A standard, always enforced mutex.
typedef SmartMutex<false> Mutex;
using Mutex = SmartMutex<false>;

template <bool mt_only>
using SmartScopedLock = std::lock_guard<SmartMutex<mt_only>>;

typedef SmartScopedLock<false> ScopedLock;
using ScopedLock = SmartScopedLock<false>;
}
}

Expand Down
32 changes: 16 additions & 16 deletions llvm/include/llvm/Support/OnDiskHashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ template <typename Info> 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<Item> BA;
Expand Down Expand Up @@ -278,12 +278,12 @@ template <typename Info> 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,
Expand Down Expand Up @@ -435,12 +435,12 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
const unsigned char *Payload;

public:
typedef OnDiskChainedHashTable<Info> 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<Info>;
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.
Expand All @@ -450,7 +450,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
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) {}
Expand Down Expand Up @@ -505,7 +505,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
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)
Expand Down Expand Up @@ -551,7 +551,7 @@ class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
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)
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/PointerLikeTypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ template <> struct PointerLikeTypeTraits<void *> {

// Provide PointerLikeTypeTraits for const things.
template <typename T> struct PointerLikeTypeTraits<const T> {
typedef PointerLikeTypeTraits<T> NonConst;
using NonConst = PointerLikeTypeTraits<T>;

static inline const void *getAsVoidPointer(const T P) {
return NonConst::getAsVoidPointer(P);
Expand All @@ -83,7 +83,7 @@ template <typename T> struct PointerLikeTypeTraits<const T> {

// Provide PointerLikeTypeTraits for const pointers.
template <typename T> struct PointerLikeTypeTraits<const T *> {
typedef PointerLikeTypeTraits<T *> NonConst;
using NonConst = PointerLikeTypeTraits<T *>;

static inline const void *getAsVoidPointer(const T *P) {
return NonConst::getAsVoidPointer(const_cast<T *>(P));
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/RISCVISAUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ struct ExtensionComparator {

/// OrderedExtensionMap is std::map, it's specialized to keep entries
/// in canonical order of extension.
typedef std::map<std::string, ExtensionVersion, ExtensionComparator>
OrderedExtensionMap;
using OrderedExtensionMap =
std::map<std::string, ExtensionVersion, ExtensionComparator>;

} // namespace RISCVISAUtils

Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Support/RWMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ template <bool mt_only> class SmartRWMutex {
bool try_lock() { return impl.try_lock(); }
};

typedef SmartRWMutex<false> RWMutex;
using RWMutex = SmartRWMutex<false>;

/// ScopedReader - RAII acquisition of a reader lock
#if !defined(LLVM_USE_RW_MUTEX_IMPL)
Expand All @@ -179,7 +179,7 @@ template <bool mt_only> struct SmartScopedReader {
~SmartScopedReader() { mutex.unlock_shared(); }
};
#endif
typedef SmartScopedReader<false> ScopedReader;
using ScopedReader = SmartScopedReader<false>;

/// ScopedWriter - RAII acquisition of a writer lock
#if !defined(LLVM_USE_RW_MUTEX_IMPL)
Expand All @@ -196,7 +196,7 @@ template <bool mt_only> struct SmartScopedWriter {
~SmartScopedWriter() { mutex.unlock(); }
};
#endif
typedef SmartScopedWriter<false> ScopedWriter;
using ScopedWriter = SmartScopedWriter<false>;

} // end namespace sys
} // end namespace llvm
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/Registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace llvm {
template <typename T>
class Registry {
public:
typedef T type;
typedef SimpleRegistryEntry<T> entry;
using type = T;
using entry = SimpleRegistryEntry<T>;

class node;
class iterator;
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Support/ScaledNumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@ template <class DigitsT> class ScaledNumber : ScaledNumberBase {
static_assert(!std::numeric_limits<DigitsT>::is_signed,
"only unsigned floats supported");

typedef DigitsT DigitsType;
using DigitsType = DigitsT;

private:
typedef std::numeric_limits<DigitsType> DigitsLimits;
using DigitsLimits = std::numeric_limits<DigitsType>;

static constexpr int Width = sizeof(DigitsType) * 8;
static_assert(Width <= 64, "invalid integer width for digits");
Expand Down Expand Up @@ -782,7 +782,7 @@ uint64_t ScaledNumber<DigitsT>::scale(uint64_t N) const {
template <class DigitsT>
template <class IntT>
IntT ScaledNumber<DigitsT>::toInt() const {
typedef std::numeric_limits<IntT> Limits;
using Limits = std::numeric_limits<IntT>;
if (*this < 1)
return 0;
if (*this >= Limits::max())
Expand Down
Loading