Skip to content

[libc++] Enable _LIBCPP_NODEBUG again #123318

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

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

philnik777
Copy link
Contributor

_LIBCPP_NODEBUG has been disabled temporarily, since there were a few problems when adding a bunch of annotations throughout the code base. They have been resolved now, so we can enable all the annotations again.

Reverts #122393

@philnik777 philnik777 requested a review from a team as a code owner January 17, 2025 10:39
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 17, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 17, 2025

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

_LIBCPP_NODEBUG has been disabled temporarily, since there were a few problems when adding a bunch of annotations throughout the code base. They have been resolved now, so we can enable all the annotations again.

Reverts llvm/llvm-project#122393


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

2 Files Affected:

  • (modified) libcxx/include/__config (+1-3)
  • (modified) libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp (+1-1)
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 658a7e16fae916..5d5c90d7b87a7b 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1166,9 +1166,7 @@ typedef __char32_t char32_t;
 #    define _LIBCPP_NOESCAPE
 #  endif
 
-// FIXME: Expand this to [[__gnu__::__nodebug__]] again once the testcase reported in
-// https://github.com/llvm/llvm-project/pull/118710 has been analyzed
-#  define _LIBCPP_NODEBUG
+#  define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]]
 
 #  if __has_attribute(__standalone_debug__)
 #    define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
diff --git a/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp b/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
index f49f3e3c615ca9..bc7c8ce7ec443a 100644
--- a/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
+++ b/libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp
@@ -27,7 +27,7 @@ class LibcxxTestModule : public clang::tidy::ClangTidyModule {
     check_factories.registerCheck<libcpp::header_exportable_declarations>("libcpp-header-exportable-declarations");
     check_factories.registerCheck<libcpp::hide_from_abi>("libcpp-hide-from-abi");
     check_factories.registerCheck<libcpp::internal_ftm_use>("libcpp-internal-ftms");
-    // check_factories.registerCheck<libcpp::nodebug_on_aliases>("libcpp-nodebug-on-aliases");
+    check_factories.registerCheck<libcpp::nodebug_on_aliases>("libcpp-nodebug-on-aliases");
     check_factories.registerCheck<libcpp::proper_version_checks>("libcpp-cpp-version-check");
     check_factories.registerCheck<libcpp::robust_against_adl_check>("libcpp-robust-against-adl");
     check_factories.registerCheck<libcpp::uglify_attributes>("libcpp-uglify-attributes");

@philnik777 philnik777 merged commit c83e5e8 into main Jan 17, 2025
83 checks passed
@philnik777 philnik777 deleted the revert-122393-disable_nodebug branch January 17, 2025 17:17
@nico
Copy link
Contributor

nico commented Jan 29, 2025

This depends on a clang that has 504dd57 and #123253 to work. Those are very recent clang changes. Doesn't libc++ usually support building with clangs that are older than tip-of-tree?

@philnik777
Copy link
Contributor Author

This depends on a clang that has 504dd57 and #123253 to work. Those are very recent clang changes. Doesn't libc++ usually support building with clangs that are older than tip-of-tree?

Yes, to some extent. We support older releases in general, but not clang built from arbitrary commits. I was under the impression that these bugs were recent and the cases where you run into them are relatively obscure. Not sure there is any basis in reality for that impression though. Did you run into issues with older compilers due to this?

@ldionne
Copy link
Member

ldionne commented Jan 29, 2025

The other alternative would be to use #if __clang_ >= version to conditionally enable _LIBCPP_NODEBUG, but that would have an adverse effect on older clangs as well, so that may not be the best option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants