[libcxx-commits] [libcxxabi] [libcxxabi] Update ItaniumDemangle.h from LLVM (PR #140273)

Oliver Hunt via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 16 17:14:13 PDT 2025


ojhunt wrote:

> > was the issue including it in the lib headers?
> 
> Not sure what you mean here by lib headers. The issue was that `ItaniumDemangle.h` now referenced a header in `llvm/Support` which is not allowed. It is probably fine in LLVM given everything that includes `ItaniumDemangle.h` presumably also links/includes `llvm/Support`, but this is not the case in `libcxxabi` where the files need to match.
> 
> Layering violations in general are somewhat difficult to catch automatically. `bazel` has explicit checks for it, but CMake does not. I think they sometimes pop up in shared library builds, but not necessarily. This one is basically impossible to catch through a build failure. Automation to ensure the `libcxxabi` and `llvm` versions match though should be sufficient for this case as you would get a build error if a file in `libcxxabi` tried to include something from `llvm/`.

Sorry, the problem is that from my pov ItaniumMangle was in llvm, so I'm trying to understand what the rules for limiting its inclusion of llvm headers.

By lib headers, I meant ItaniumMangle is in the `llvm/include/llvm` directory, and it sounds like that's for api/library headers, so including things like `llvm/Support` isn't safe/allowed as those are internal/implementation headers.

Is that correct?

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


More information about the libcxx-commits mailing list