[libcxx-commits] [libcxxabi] [libcxxabi/demangle] Remove __cxxabi_config.h include (PR #101971)

Nico Weber via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 5 06:16:04 PDT 2024


https://github.com/nico created https://github.com/llvm/llvm-project/pull/101971

The demangler is shared between libcxxabi and llvm/lib/Demangle, see libcxxabi/src/demangle/README.txt. The copy in llvm/lib/Demangle cannot use __cxxabi_config.h. Remove the include. It was only used to identify clang, which can easily be done without the include as well.

No intended behavior change.

>From 367e7919713f46cc83d5585136d746d5ddf4df40 Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis at chromium.org>
Date: Mon, 5 Aug 2024 09:14:19 -0400
Subject: [PATCH] [libcxxabi/demangle] Remove __cxxabi_config.h include

The demangler is shared between libcxxabi and llvm/lib/Demangle, see
libcxxabi/src/demangle/README.txt. The copy in llvm/lib/Demangle cannot
use __cxxabi_config.h. Remove the include. It was only used to identify
clang, which can easily be done without the include as well.

No intended behavior change.
---
 libcxxabi/src/demangle/ItaniumDemangle.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index ecc9b1aeb5c6f..88de234a6e0b9 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -19,7 +19,6 @@
 #include "DemangleConfig.h"
 #include "StringViewExtras.h"
 #include "Utility.h"
-#include <__cxxabi_config.h>
 #include <algorithm>
 #include <cctype>
 #include <cstdio>
@@ -31,7 +30,7 @@
 #include <type_traits>
 #include <utility>
 
-#ifdef _LIBCXXABI_COMPILER_CLANG
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-template"
 #endif
@@ -5948,7 +5947,7 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
 
 DEMANGLE_NAMESPACE_END
 
-#ifdef _LIBCXXABI_COMPILER_CLANG
+#if defined(__clang__)
 #pragma clang diagnostic pop
 #endif
 



More information about the libcxx-commits mailing list