[clang] [include-cleaner] Support multi-header symbols in mapping generator (PR #147720)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 24 07:04:22 PDT 2025


=?utf-8?q?Ildikó?= Cseri <cseriildiko at icloud.com>,
=?utf-8?q?Ildikó?= Cseri <cseriildiko at icloud.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/147720 at github.com>


================
@@ -690,6 +1391,23 @@ SYMBOL(atol, None, <stdlib.h>)
 SYMBOL(atoll, std::, <cstdlib>)
 SYMBOL(atoll, None, <cstdlib>)
 SYMBOL(atoll, None, <stdlib.h>)
+SYMBOL(atomic, std::, <atomic>)
+SYMBOL(atomic, std::, <memory>)
+SYMBOL(atomic_bool, std::, <atomic>)
+SYMBOL(atomic_bool, std::, <memory>)
+SYMBOL(atomic_bool, std::, <stdatomic.h>)
----------------
itislu wrote:

This can be fixed by sorting the `CSymbols`/`CXXSymbols` arrays by symbol name in `StandardLibrary.cpp`, since there they have all been merged together.
I [tried it](https://github.com/itislu/llvm-project/commit/bbb5f4f1d735b07fac8abd35b5714bf6f7fa60c8) and then it didn't crash anymore.
However, my quick fix does the sorting at runtime, as `std::sort` is not yet `constexpr` in C++17.
We can think about sorting the symbols as part of the build system, or adding a local `constexpr` sorting function.

https://github.com/llvm/llvm-project/pull/147720


More information about the cfe-commits mailing list