aboutsummaryrefslogtreecommitdiff
path: root/libbase/include/core
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-11-02 11:05:18 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-11-02 11:05:18 +0800
commit3cba709128fc153533e029226b3f09b1ae7ac18e (patch)
tree6f2d752feb8ecc49bd35fb90146e3e1d4ae4bd6f /libbase/include/core
parent47c262e7ea143311a9fea4b33c0ad24a0bcb83f5 (diff)
downloadrcc-project-3cba709128fc153533e029226b3f09b1ae7ac18e.tar.gz
rcc-project-3cba709128fc153533e029226b3f09b1ae7ac18e.tar.xz
[libbase] Rename public namespace and unreachable symbolsHEADmaster
Diffstat (limited to 'libbase/include/core')
-rw-r--r--libbase/include/core/adt/STLFunctionalExtras.h4
-rw-r--r--libbase/include/core/adt/SmallVector.h16
-rw-r--r--libbase/include/core/error/Errno.h4
-rw-r--r--libbase/include/core/error/ErrorHandling.h18
-rw-r--r--libbase/include/core/math/MathExtras.h6
-rw-r--r--libbase/include/core/memory/Alignment.h8
-rw-r--r--libbase/include/core/memory/AllocatorBase.h4
-rw-r--r--libbase/include/core/memory/MemAlloc.h4
8 files changed, 32 insertions, 32 deletions
diff --git a/libbase/include/core/adt/STLFunctionalExtras.h b/libbase/include/core/adt/STLFunctionalExtras.h
index 231dc5b..8c88905 100644
--- a/libbase/include/core/adt/STLFunctionalExtras.h
+++ b/libbase/include/core/adt/STLFunctionalExtras.h
@@ -43,7 +43,7 @@
#include <type_traits>
#include <utility>
-namespace rcc
+namespace libbase
{
//===----------------------------------------------------------------------===//
@@ -107,6 +107,6 @@ public:
}
};
-} // end namespace rcc
+} // end namespace libbase
#endif // LIBBASE_ADT_STLFUNCTIONALEXTRAS_H
diff --git a/libbase/include/core/adt/SmallVector.h b/libbase/include/core/adt/SmallVector.h
index 52cb6ca..f8de25e 100644
--- a/libbase/include/core/adt/SmallVector.h
+++ b/libbase/include/core/adt/SmallVector.h
@@ -52,7 +52,7 @@
#include <type_traits>
#include <utility>
-namespace rcc
+namespace libbase
{
template <typename T> class ArrayRef;
@@ -1879,20 +1879,20 @@ to_vector_of (R &&Range)
}
// Explicit instantiations
-extern template class rcc::SmallVectorBase<uint32_t>;
+extern template class libbase::SmallVectorBase<uint32_t>;
#if SIZE_MAX > UINT32_MAX
-extern template class rcc::SmallVectorBase<uint64_t>;
+extern template class libbase::SmallVectorBase<uint64_t>;
#endif
-} // end namespace rcc
+} // end namespace libbase
namespace std
{
-template <typename T, unsigned N> struct hash<rcc::SmallVector<T, N>>
+template <typename T, unsigned N> struct hash<libbase::SmallVector<T, N>>
{
size_t
- operator() (const rcc::SmallVector<T, N> &Value) const
+ operator() (const libbase::SmallVector<T, N> &Value) const
{
size_t Seed = 0;
for (const T &Element : Value)
@@ -1908,7 +1908,7 @@ template <typename T, unsigned N> struct hash<rcc::SmallVector<T, N>>
/// Implement std::swap in terms of SmallVector swap.
template <typename T>
inline void
-swap (rcc::SmallVectorImpl<T> &LHS, rcc::SmallVectorImpl<T> &RHS)
+swap (libbase::SmallVectorImpl<T> &LHS, libbase::SmallVectorImpl<T> &RHS)
{
LHS.swap (RHS);
}
@@ -1916,7 +1916,7 @@ swap (rcc::SmallVectorImpl<T> &LHS, rcc::SmallVectorImpl<T> &RHS)
/// Implement std::swap in terms of SmallVector swap.
template <typename T, unsigned N>
inline void
-swap (rcc::SmallVector<T, N> &LHS, rcc::SmallVector<T, N> &RHS)
+swap (libbase::SmallVector<T, N> &LHS, libbase::SmallVector<T, N> &RHS)
{
LHS.swap (RHS);
}
diff --git a/libbase/include/core/error/Errno.h b/libbase/include/core/error/Errno.h
index 01d4ff8..9f0c3b9 100644
--- a/libbase/include/core/error/Errno.h
+++ b/libbase/include/core/error/Errno.h
@@ -29,7 +29,7 @@
#include <cerrno>
#include <string>
-namespace rcc
+namespace libbase
{
namespace sys
{
@@ -59,6 +59,6 @@ RetryAfterSignal (const FailT &Fail, const Fun &F, const Args &...As)
}
} // namespace sys
-} // namespace rcc
+} // namespace libbase
#endif // LIBBASE_SUPPORT_ERRNO_H
diff --git a/libbase/include/core/error/ErrorHandling.h b/libbase/include/core/error/ErrorHandling.h
index b27104c..485d2d1 100644
--- a/libbase/include/core/error/ErrorHandling.h
+++ b/libbase/include/core/error/ErrorHandling.h
@@ -37,7 +37,7 @@
#include "core/compiler/Compiler.h"
-namespace rcc
+namespace libbase
{
class StringRef;
class Twine;
@@ -177,9 +177,9 @@ report_bad_alloc_error (const char *Reason, bool GenCrashDiag = true);
/// Use the llvm_unreachable macro (that adds location info), instead of
/// calling this function directly.
[[noreturn]] LIBBASE_ABI void
-rcc_unreachable_internal (const char *msg = nullptr, const char *file = nullptr,
- unsigned line = 0);
-} // namespace rcc
+libbase_unreachable_internal (const char *msg = nullptr,
+ const char *file = nullptr, unsigned line = 0);
+} // namespace libbase
/// Marks that the current location is not supposed to be reachable.
/// In !NDEBUG builds, prints the message and location info to stderr.
@@ -199,14 +199,14 @@ rcc_unreachable_internal (const char *msg = nullptr, const char *file = nullptr,
/// diagnostics for unreachable code paths, and allows compilers to omit
/// unnecessary code.
#ifndef NDEBUG
-#define rcc_unreachable(msg) \
- ::rcc::rcc_unreachable_internal (msg, __FILE__, __LINE__)
+#define libbase_unreachable(msg) \
+ ::libbase::libbase_unreachable_internal (msg, __FILE__, __LINE__)
#elif !defined(LIBBASE_BUILTIN_UNREACHABLE)
-#define rcc_unreachable(msg) ::rcc::rcc_unreachable_internal ()
+#define libbase_unreachable(msg) ::libbase::libbase_unreachable_internal ()
#elif LIBBASE_UNREACHABLE_OPTIMIZE
-#define rcc_unreachable(msg) LIBBASE_BUILTIN_UNREACHABLE
+#define libbase_unreachable(msg) LIBBASE_BUILTIN_UNREACHABLE
#else
-#define rcc_unreachable(msg) \
+#define libbase_unreachable(msg) \
do \
{ \
LIBBASE_BUILTIN_TRAP; \
diff --git a/libbase/include/core/math/MathExtras.h b/libbase/include/core/math/MathExtras.h
index 880ba74..732f82c 100644
--- a/libbase/include/core/math/MathExtras.h
+++ b/libbase/include/core/math/MathExtras.h
@@ -45,7 +45,7 @@
#include <type_traits>
#include <utility>
-namespace rcc
+namespace libbase
{
/// Some template parameter helpers to optimize for bitwidth, for functions that
/// take multiple arguments.
@@ -432,7 +432,7 @@ template <size_t kValue>
constexpr size_t
ConstantLog2 ()
{
- static_assert (rcc::isPowerOf2_64 (kValue),
+ static_assert (libbase::isPowerOf2_64 (kValue),
"Value is not a valid power of 2");
return std::countr_zero (kValue);
}
@@ -1045,6 +1045,6 @@ using stack_float_t = float;
LIBBASE_ABI int
NumDigitsBase10 (uint64_t X);
-} // namespace rcc
+} // namespace libbase
#endif
diff --git a/libbase/include/core/memory/Alignment.h b/libbase/include/core/memory/Alignment.h
index 22299e1..4078cd6 100644
--- a/libbase/include/core/memory/Alignment.h
+++ b/libbase/include/core/memory/Alignment.h
@@ -49,7 +49,7 @@
#include <string>
#endif // NDEBUG
-namespace rcc {
+namespace libbase {
#define ALIGN_CHECK_ISPOSITIVE(decl) \
assert(decl > 0 && (#decl " should be defined"))
@@ -85,7 +85,7 @@ public:
explicit Align(uint64_t Value) {
assert(Value > 0 && "Value must not be 0");
- assert(rcc::isPowerOf2_64(Value) && "Alignment is not a power of 2");
+ assert(libbase::isPowerOf2_64(Value) && "Alignment is not a power of 2");
ShiftValue = Log2_64(Value);
assert(ShiftValue < 64 && "Broken invariant");
}
@@ -146,7 +146,7 @@ public:
constexpr MaybeAlign(std::nullopt_t None) : UP(None) {}
constexpr MaybeAlign(Align Value) : UP(Value) {}
explicit MaybeAlign(uint64_t Value) {
- assert((Value == 0 || rcc::isPowerOf2_64(Value)) &&
+ assert((Value == 0 || libbase::isPowerOf2_64(Value)) &&
"Alignment is neither 0 nor a power of 2");
if (Value)
emplace(Value);
@@ -337,6 +337,6 @@ inline std::string DebugStr(const MaybeAlign &MA) {
#undef ALIGN_CHECK_ISPOSITIVE
-} // namespace rcc
+} // namespace libbase
#endif // LIBBASE_SUPPORT_ALIGNMENT_H_
diff --git a/libbase/include/core/memory/AllocatorBase.h b/libbase/include/core/memory/AllocatorBase.h
index 77cb84b..0f7f9f1 100644
--- a/libbase/include/core/memory/AllocatorBase.h
+++ b/libbase/include/core/memory/AllocatorBase.h
@@ -51,7 +51,7 @@
#include <type_traits>
#include <utility>
-namespace rcc {
+namespace libbase {
/// CRTP base class providing obvious overloads for the core \c
/// Allocate() methods of LLVM-style allocators.
@@ -149,6 +149,6 @@ public:
} // namespace detail
-} // namespace rcc
+} // namespace libbase
#endif // LIBBASE_SUPPORT_ALLOCATORBASE_H
diff --git a/libbase/include/core/memory/MemAlloc.h b/libbase/include/core/memory/MemAlloc.h
index bd98864..7b00ceb 100644
--- a/libbase/include/core/memory/MemAlloc.h
+++ b/libbase/include/core/memory/MemAlloc.h
@@ -41,7 +41,7 @@
#include "core/error/ErrorHandling.h"
#include <cstdlib>
-namespace rcc
+namespace libbase
{
LIBBASE_ATTRIBUTE_RETURNS_NONNULL inline void *
@@ -120,5 +120,5 @@ allocate_buffer (size_t Size, size_t Alignment);
LIBBASE_ABI void
deallocate_buffer (void *Ptr, size_t Size, size_t Alignment);
-} // namespace rcc
+} // namespace libbase
#endif