Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] remove BlockStore from cpp namespace #85312

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

nickdesaulniers
Copy link
Member

The cpp namespace should only be used to mirror APIs from C++'s std:: namespace
(at least until we share more code with libc++, see
https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701)

The cpp namespace should only be used to mirror APIs from C++'s std:: namespace
(at least until we share more code with libc++, see
https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701)
@llvmbot llvmbot added the libc label Mar 14, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 14, 2024

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Changes

The cpp namespace should only be used to mirror APIs from C++'s std:: namespace
(at least until we share more code with libc++, see
https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701)


Full diff: https://github.com/llvm/llvm-project/pull/85312.diff

2 Files Affected:

  • (modified) libc/src/__support/blockstore.h (-2)
  • (modified) libc/src/stdlib/atexit.cpp (+1-1)
diff --git a/libc/src/__support/blockstore.h b/libc/src/__support/blockstore.h
index dc5fdd1b92fc29..ac0eb22692b40c 100644
--- a/libc/src/__support/blockstore.h
+++ b/libc/src/__support/blockstore.h
@@ -16,7 +16,6 @@
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {
-namespace cpp {
 
 // The difference between BlockStore a traditional vector types is that,
 // when more capacity is desired, a new block is added instead of allocating
@@ -203,7 +202,6 @@ void BlockStore<T, BLOCK_SIZE, REVERSE_ORDER>::destroy(
 template <typename T, size_t BLOCK_SIZE>
 using ReverseOrderBlockStore = BlockStore<T, BLOCK_SIZE, true>;
 
-} // namespace cpp
 } // namespace LIBC_NAMESPACE
 
 #endif // LLVM_LIBC_SRC___SUPPORT_BLOCKSTORE_H
diff --git a/libc/src/stdlib/atexit.cpp b/libc/src/stdlib/atexit.cpp
index 1513b7969f0dbc..741ea4f25103ac 100644
--- a/libc/src/stdlib/atexit.cpp
+++ b/libc/src/stdlib/atexit.cpp
@@ -36,7 +36,7 @@ struct AtExitUnit {
 //        mutexes simply passthrough. We will need a lock free stack.
 using ExitCallbackList = FixedVector<AtExitUnit, 64>;
 #elif defined(LIBC_COPT_PUBLIC_PACKAGING)
-using ExitCallbackList = cpp::ReverseOrderBlockStore<AtExitUnit, 32>;
+using ExitCallbackList = ReverseOrderBlockStore<AtExitUnit, 32>;
 #else
 // BlockStore uses dynamic memory allocation. To avoid dynamic memory
 // allocation in tests, we use a fixed size callback list when built for

@lntue
Copy link
Contributor

lntue commented Mar 14, 2024

Look like you need to update some tests also.

@nickdesaulniers nickdesaulniers merged commit 6503eff into llvm:main Mar 15, 2024
4 checks passed
@nickdesaulniers nickdesaulniers deleted the BlockStore branch March 15, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants