summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/ADT/DenseSet.h40
-rw-r--r--llvm/include/llvm/ADT/StringExtras.h9
-rw-r--r--llvm/include/llvm/Support/Host.h10
-rw-r--r--llvm/include/llvm/Support/MathExtras.h6
-rw-r--r--llvm/lib/Support/Chrono.cpp12
-rw-r--r--llvm/lib/Support/Host.cpp12
-rw-r--r--llvm/unittests/Support/Host.cpp23
7 files changed, 56 insertions, 56 deletions
diff --git a/llvm/include/llvm/ADT/DenseSet.h b/llvm/include/llvm/ADT/DenseSet.h
index 8d7d6130233..fcf304c3ecc 100644
--- a/llvm/include/llvm/ADT/DenseSet.h
+++ b/llvm/include/llvm/ADT/DenseSet.h
@@ -179,12 +179,12 @@ public:
void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
std::pair<iterator, bool> insert(const ValueT &V) {
- llvm::detail::DenseSetEmpty Empty;
+ detail::DenseSetEmpty Empty;
return TheMap.try_emplace(V, Empty);
}
std::pair<iterator, bool> insert(ValueT &&V) {
- llvm::detail::DenseSetEmpty Empty;
+ detail::DenseSetEmpty Empty;
return TheMap.try_emplace(std::move(V), Empty);
}
@@ -193,12 +193,11 @@ public:
template <typename LookupKeyT>
std::pair<iterator, bool> insert_as(const ValueT &V,
const LookupKeyT &LookupKey) {
- return TheMap.insert_as({V, llvm::detail::DenseSetEmpty()}, LookupKey);
+ return TheMap.insert_as({V, detail::DenseSetEmpty()}, LookupKey);
}
template <typename LookupKeyT>
std::pair<iterator, bool> insert_as(ValueT &&V, const LookupKeyT &LookupKey) {
- return TheMap.insert_as({std::move(V), llvm::detail::DenseSetEmpty()},
- LookupKey);
+ return TheMap.insert_as({std::move(V), detail::DenseSetEmpty()}, LookupKey);
}
// Range insertion of values.
@@ -213,15 +212,15 @@ public:
/// Implements a dense probed hash-table based set.
template <typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT>>
-class DenseSet
- : public llvm::detail::DenseSetImpl<
- ValueT, DenseMap<ValueT, llvm::detail::DenseSetEmpty, ValueInfoT,
- llvm::detail::DenseSetPair<ValueT>>,
- ValueInfoT> {
- using BaseT = llvm::detail::DenseSetImpl<
- ValueT, DenseMap<ValueT, llvm::detail::DenseSetEmpty, ValueInfoT,
- llvm::detail::DenseSetPair<ValueT>>,
- ValueInfoT>;
+class DenseSet : public detail::DenseSetImpl<
+ ValueT, DenseMap<ValueT, detail::DenseSetEmpty, ValueInfoT,
+ detail::DenseSetPair<ValueT>>,
+ ValueInfoT> {
+ using BaseT =
+ detail::DenseSetImpl<ValueT,
+ DenseMap<ValueT, detail::DenseSetEmpty, ValueInfoT,
+ detail::DenseSetPair<ValueT>>,
+ ValueInfoT>;
public:
using BaseT::BaseT;
@@ -232,14 +231,13 @@ public:
template <typename ValueT, unsigned InlineBuckets = 4,
typename ValueInfoT = DenseMapInfo<ValueT>>
class SmallDenseSet
- : public llvm::detail::DenseSetImpl<
- ValueT,
- SmallDenseMap<ValueT, llvm::detail::DenseSetEmpty, InlineBuckets,
- ValueInfoT, llvm::detail::DenseSetPair<ValueT>>,
+ : public detail::DenseSetImpl<
+ ValueT, SmallDenseMap<ValueT, detail::DenseSetEmpty, InlineBuckets,
+ ValueInfoT, detail::DenseSetPair<ValueT>>,
ValueInfoT> {
- using BaseT = llvm::detail::DenseSetImpl<
- ValueT, SmallDenseMap<ValueT, llvm::detail::DenseSetEmpty, InlineBuckets,
- ValueInfoT, llvm::detail::DenseSetPair<ValueT>>,
+ using BaseT = detail::DenseSetImpl<
+ ValueT, SmallDenseMap<ValueT, detail::DenseSetEmpty, InlineBuckets,
+ ValueInfoT, detail::DenseSetPair<ValueT>>,
ValueInfoT>;
public:
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
index ae65f29cfe1..8214782bfe8 100644
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -231,7 +231,7 @@ inline size_t join_items_size(const A1 &A, Args &&... Items) {
template <typename IteratorT>
inline std::string join(IteratorT Begin, IteratorT End, StringRef Separator) {
typedef typename std::iterator_traits<IteratorT>::iterator_category tag;
- return llvm::detail::join_impl(Begin, End, Separator, tag());
+ return detail::join_impl(Begin, End, Separator, tag());
}
/// Joins the strings in the range [R.begin(), R.end()), adding Separator
@@ -251,11 +251,10 @@ inline std::string join_items(Sep Separator, Args &&... Items) {
if (sizeof...(Items) == 0)
return Result;
- size_t NS = llvm::detail::join_one_item_size(Separator);
- size_t NI = llvm::detail::join_items_size(std::forward<Args>(Items)...);
+ size_t NS = detail::join_one_item_size(Separator);
+ size_t NI = detail::join_items_size(std::forward<Args>(Items)...);
Result.reserve(NI + (sizeof...(Items) - 1) * NS + 1);
- llvm::detail::join_items_impl(Result, Separator,
- std::forward<Args>(Items)...);
+ detail::join_items_impl(Result, Separator, std::forward<Args>(Items)...);
return Result;
}
diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h
index 89986fdae97..22a61f76064 100644
--- a/llvm/include/llvm/Support/Host.h
+++ b/llvm/include/llvm/Support/Host.h
@@ -77,11 +77,11 @@ constexpr bool IsBigEndianHost = false;
/// Returns -1 if unknown for the current host system.
int getHostNumPhysicalCores();
- namespace detail {
- /// Helper functions to extract HostCPUName from /proc/cpuinfo on linux.
- StringRef getHostCPUNameForPowerPC(const StringRef &ProcCpuinfoContent);
- StringRef getHostCPUNameForARM(const StringRef &ProcCpuinfoContent);
- StringRef getHostCPUNameForS390x(const StringRef &ProcCpuinfoContent);
+ /// helper functions to extract HostCPUName from /proc/cpuinfo on linux.
+ namespace LinuxReadCpuInfo {
+ StringRef getHostCPUName_powerpc(const StringRef &ProcCpuinfoContent);
+ StringRef getHostCPUName_arm(const StringRef &ProcCpuinfoContent);
+ StringRef getHostCPUName_s390x(const StringRef &ProcCpuinfoContent);
}
}
}
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index 846ab664660..77970f48711 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -112,7 +112,7 @@ std::size_t countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
static_assert(std::numeric_limits<T>::is_integer &&
!std::numeric_limits<T>::is_signed,
"Only unsigned integral types are allowed.");
- return llvm::detail::TrailingZerosCounter<T, sizeof(T)>::count(Val, ZB);
+ return detail::TrailingZerosCounter<T, sizeof(T)>::count(Val, ZB);
}
namespace detail {
@@ -181,7 +181,7 @@ std::size_t countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
static_assert(std::numeric_limits<T>::is_integer &&
!std::numeric_limits<T>::is_signed,
"Only unsigned integral types are allowed.");
- return llvm::detail::LeadingZerosCounter<T, sizeof(T)>::count(Val, ZB);
+ return detail::LeadingZerosCounter<T, sizeof(T)>::count(Val, ZB);
}
/// \brief Get the index of the first set bit starting from the least
@@ -495,7 +495,7 @@ inline unsigned countPopulation(T Value) {
static_assert(std::numeric_limits<T>::is_integer &&
!std::numeric_limits<T>::is_signed,
"Only unsigned integral types are allowed.");
- return llvm::detail::PopulationCounter<T, sizeof(T)>::count(Value);
+ return detail::PopulationCounter<T, sizeof(T)>::count(Value);
}
/// Log2 - This function returns the log base 2 of the specified value
diff --git a/llvm/lib/Support/Chrono.cpp b/llvm/lib/Support/Chrono.cpp
index daccaf1fc10..ca748f5c046 100644
--- a/llvm/lib/Support/Chrono.cpp
+++ b/llvm/lib/Support/Chrono.cpp
@@ -16,12 +16,12 @@ namespace llvm {
using namespace sys;
-const char llvm::detail::unit<std::ratio<3600>>::value[] = "h";
-const char llvm::detail::unit<std::ratio<60>>::value[] = "m";
-const char llvm::detail::unit<std::ratio<1>>::value[] = "s";
-const char llvm::detail::unit<std::milli>::value[] = "ms";
-const char llvm::detail::unit<std::micro>::value[] = "us";
-const char llvm::detail::unit<std::nano>::value[] = "ns";
+const char detail::unit<std::ratio<3600>>::value[] = "h";
+const char detail::unit<std::ratio<60>>::value[] = "m";
+const char detail::unit<std::ratio<1>>::value[] = "s";
+const char detail::unit<std::milli>::value[] = "ms";
+const char detail::unit<std::micro>::value[] = "us";
+const char detail::unit<std::nano>::value[] = "ns";
static inline struct tm getStructTM(TimePoint<> TP) {
struct tm Storage;
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 54fbb558c43..230d0921184 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -64,7 +64,7 @@ static std::unique_ptr<llvm::MemoryBuffer>
return std::move(*Text);
}
-StringRef sys::detail::getHostCPUNameForPowerPC(
+StringRef sys::LinuxReadCpuInfo::getHostCPUName_powerpc(
const StringRef &ProcCpuinfoContent) {
// Access to the Processor Version Register (PVR) on PowerPC is privileged,
// and so we must use an operating-system interface to determine the current
@@ -144,7 +144,7 @@ StringRef sys::detail::getHostCPUNameForPowerPC(
.Default(generic);
}
-StringRef sys::detail::getHostCPUNameForARM(
+StringRef sys::LinuxReadCpuInfo::getHostCPUName_arm(
const StringRef &ProcCpuinfoContent) {
// The cpuid register on arm is not accessible from user space. On Linux,
// it is exposed through the /proc/cpuinfo file.
@@ -195,7 +195,7 @@ StringRef sys::detail::getHostCPUNameForARM(
return "generic";
}
-StringRef sys::detail::getHostCPUNameForS390x(
+StringRef sys::LinuxReadCpuInfo::getHostCPUName_s390x(
const StringRef &ProcCpuinfoContent) {
// STIDP is a privileged operation, so use /proc/cpuinfo instead.
@@ -1197,19 +1197,19 @@ StringRef sys::getHostCPUName() {
StringRef sys::getHostCPUName() {
std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
const StringRef& Content = P ? P->getBuffer() : "";
- return detail::getHostCPUNameForPowerPC(Content);
+ return LinuxReadCpuInfo::getHostCPUName_powerpc(Content);
}
#elif defined(__linux__) && defined(__arm__)
StringRef sys::getHostCPUName() {
std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
const StringRef& Content = P ? P->getBuffer() : "";
- return detail::getHostCPUNameForARM(Content);
+ return LinuxReadCpuInfo::getHostCPUName_arm(Content);
}
#elif defined(__linux__) && defined(__s390x__)
StringRef sys::getHostCPUName() {
std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
const StringRef& Content = P ? P->getBuffer() : "";
- return detail::getHostCPUNameForS390x(Content);
+ return LinuxReadCpuInfo::getHostCPUName_s390x(Content);
}
#else
StringRef sys::getHostCPUName() { return "generic"; }
diff --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp
index 48f021e5427..0d22ba8ca79 100644
--- a/llvm/unittests/Support/Host.cpp
+++ b/llvm/unittests/Support/Host.cpp
@@ -66,16 +66,19 @@ Revision : 0000
Serial : 0000000000000000
)";
- EXPECT_EQ(sys::detail::getHostCPUNameForARM(CortexA9ProcCpuinfo),
+ EXPECT_EQ(sys::LinuxReadCpuInfo::getHostCPUName_arm(CortexA9ProcCpuinfo),
"cortex-a9");
- EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x41\n"
- "CPU part : 0xc0f"),
- "cortex-a15");
+ EXPECT_EQ(
+ sys::LinuxReadCpuInfo::getHostCPUName_arm("CPU implementer : 0x41\n"
+ "CPU part : 0xc0f"),
+ "cortex-a15");
// Verify that both CPU implementer and CPU part are checked:
- EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x40\n"
- "CPU part : 0xc0f"),
- "generic");
- EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x51\n"
- "CPU part : 0x06f"),
- "krait");
+ EXPECT_EQ(
+ sys::LinuxReadCpuInfo::getHostCPUName_arm("CPU implementer : 0x40\n"
+ "CPU part : 0xc0f"),
+ "generic");
+ EXPECT_EQ(
+ sys::LinuxReadCpuInfo::getHostCPUName_arm("CPU implementer : 0x51\n"
+ "CPU part : 0x06f"),
+ "krait");
}
OpenPOWER on IntegriCloud