aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/BalancedPartitioning.cpp2
-rw-r--r--llvm/lib/Support/BranchProbability.cpp2
-rw-r--r--llvm/lib/Support/CommandLine.cpp12
-rw-r--r--llvm/lib/Support/DAGDeltaAlgorithm.cpp16
-rw-r--r--llvm/lib/Support/DynamicLibrary.cpp2
-rw-r--r--llvm/lib/Support/StringRef.cpp5
-rw-r--r--llvm/lib/Support/Timer.cpp2
-rw-r--r--llvm/lib/Support/UnicodeNameToCodepoint.cpp8
8 files changed, 21 insertions, 28 deletions
diff --git a/llvm/lib/Support/BalancedPartitioning.cpp b/llvm/lib/Support/BalancedPartitioning.cpp
index 1914f4c..d859abd 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<float, BPFunctionNode *> GainPair;
+ using GainPair = std::pair<float, BPFunctionNode *>;
std::vector<GainPair> Gains;
for (auto &N : Nodes) {
bool FromLeftToRight = (N.Bucket == LeftBucket);
diff --git a/llvm/lib/Support/BranchProbability.cpp b/llvm/lib/Support/BranchProbability.cpp
index ea42f34..143e58a 100644
--- a/llvm/lib/Support/BranchProbability.cpp
+++ b/llvm/lib/Support/BranchProbability.cpp
@@ -20,8 +20,6 @@
using namespace llvm;
-constexpr uint32_t BranchProbability::D;
-
raw_ostream &BranchProbability::print(raw_ostream &OS) const {
if (isUnknown())
return OS << "?%";
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 9491ec0..dab8bee 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -382,7 +382,7 @@ public:
RegisteredSubCommands.erase(sub);
}
- iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
+ iterator_range<SmallPtrSet<SubCommand *, 4>::iterator>
getRegisteredSubcommands() {
return make_range(RegisteredSubCommands.begin(),
RegisteredSubCommands.end());
@@ -2343,10 +2343,10 @@ namespace {
class HelpPrinter {
protected:
const bool ShowHidden;
- typedef SmallVector<std::pair<const char *, Option *>, 128>
- StrOptionPairVector;
- typedef SmallVector<std::pair<const char *, SubCommand *>, 128>
- StrSubCommandPairVector;
+ using StrOptionPairVector =
+ SmallVector<std::pair<const char *, Option *>, 128>;
+ using StrSubCommandPairVector =
+ SmallVector<std::pair<const char *, SubCommand *>, 128>;
// Print the options. Opts is assumed to be alphabetically sorted.
virtual void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) {
for (const auto &Opt : Opts)
@@ -2830,7 +2830,7 @@ StringMap<Option *> &cl::getRegisteredOptions(SubCommand &Sub) {
return Sub.OptionsMap;
}
-iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
+iterator_range<SmallPtrSet<SubCommand *, 4>::iterator>
cl::getRegisteredSubcommands() {
return GlobalParser->getRegisteredSubcommands();
}
diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp
index 98153647..3bfae14 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<change_ty>::iterator pred_iterator_ty;
- typedef std::vector<change_ty>::iterator succ_iterator_ty;
- typedef std::set<change_ty>::iterator pred_closure_iterator_ty;
- typedef std::set<change_ty>::iterator succ_closure_iterator_ty;
+ using pred_iterator_ty = std::vector<change_ty>::iterator;
+ using succ_iterator_ty = std::vector<change_ty>::iterator;
+ using pred_closure_iterator_ty = std::set<change_ty>::iterator;
+ using succ_closure_iterator_ty = std::set<change_ty>::iterator;
DAGDeltaAlgorithm &DDA;
diff --git a/llvm/lib/Support/DynamicLibrary.cpp b/llvm/lib/Support/DynamicLibrary.cpp
index f1c15c0..61566d3 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<void *> HandleList;
+ using HandleList = std::vector<void *>;
HandleList Handles;
void *Process = &Invalid;
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index b6a2f8a..2e8fba8 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -17,11 +17,6 @@
using namespace llvm;
-// MSVC emits references to this into the translation units which reference it.
-#ifndef _MSC_VER
-constexpr size_t StringRef::npos;
-#endif
-
// strncasecmp() is not available on non-POSIX systems, so define an
// alternative function here.
static int ascii_strncasecmp(StringRef LHS, StringRef RHS) {
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index 9d45096..b08f508 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<Timer> Name2TimerMap;
+using Name2TimerMap = StringMap<Timer>;
class Name2PairMap {
StringMap<std::pair<TimerGroup*, Name2TimerMap> > Map;
diff --git a/llvm/lib/Support/UnicodeNameToCodepoint.cpp b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
index 6f8e091..8f0d24e 100644
--- a/llvm/lib/Support/UnicodeNameToCodepoint.cpp
+++ b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
@@ -251,10 +251,10 @@ constexpr const char *const HangulSyllables[][3] = {
// Unicode 15.0
// 3.12 Conjoining Jamo Behavior Common constants
-constexpr const char32_t SBase = 0xAC00;
-constexpr const uint32_t LCount = 19;
-constexpr const uint32_t VCount = 21;
-constexpr const uint32_t TCount = 28;
+constexpr char32_t SBase = 0xAC00;
+constexpr uint32_t LCount = 19;
+constexpr uint32_t VCount = 21;
+constexpr uint32_t TCount = 28;
static std::size_t findSyllable(StringRef Name, bool Strict,
char &PreviousInName, int &Pos, int Column) {