Skip to content

[llvm] simplify and clean-up DemangleConfig.h #149163

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
Jul 22, 2025

Conversation

andrurogerz
Copy link
Contributor

Purpose

Simplify DEMANGLE_ macro definitions in llvm/Demangle/DemangleConfig.h for clarity/maintainability.

Overview

  • Alias DEMANGLE_DUMP_METHOD, DEMANGLE_FALLTHROUGH, and DEMANGLE_UNREACHABLE macros to their LLVM_ counterparts defined in llvm/Support/Compiler.h
  • Remove several DEMANGLE_-prefixed macros that were only used within DemangleConfig.h

Background

  • It should be safe for the Demangle component library to depend on Support, so there is no need for it to maintain copies of macros defined in llvm/Support/Compiler.h.
  • Since the canonical copy llvm/Demangle/ItaniumDemangle.h lives under libcxxabi, it cannot directly reference the LLVM_-prefixed macros so we define DEMANGLE_-prefixed aliases.

Validation

  • Built llvm-project on Windows with clang-cl and MSVC cl.
  • Built llvm-project on Linux with clang and gcc.

@andrurogerz andrurogerz marked this pull request as ready for review July 16, 2025 19:53
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrurogerz
Copy link
Contributor Author

@compnerd, @vgvassilev would one of you be willing to merge this patch for me? It is blocking #147564. Thanks!

@compnerd compnerd merged commit efbe98d into llvm:main Jul 22, 2025
12 checks passed
@andrurogerz andrurogerz deleted the llvm-demangle-config branch July 22, 2025 22:25
@rupprecht
Copy link
Collaborator

It should be safe for the Demangle component library to depend on Support, so there is no need for it to maintain copies of macros defined in llvm/Support/Compiler.h.

This commit creates a library layering violation because Support already depends on Demangle, e.g.

#include "llvm/Demangle/Demangle.h"

Is there another way you can land this commit w/o creating a cycle?

SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Jul 23, 2025
## Purpose
Simplify `DEMANGLE_` macro definitions in
`llvm/Demangle/DemangleConfig.h` for clarity/maintainability.

## Overview
* Alias `DEMANGLE_DUMP_METHOD`, `DEMANGLE_FALLTHROUGH`, and
`DEMANGLE_UNREACHABLE` macros to their `LLVM_` counterparts defined in
`llvm/Support/Compiler.h`
* Remove several `DEMANGLE_`-prefixed macros that were only used within
`DemangleConfig.h`

## Background
* It should be safe for the `Demangle` component library to depend on
`Support`, so there is no need for it to maintain copies of macros
defined in `llvm/Support/Compiler.h`.
* Since the canonical copy `llvm/Demangle/ItaniumDemangle.h` lives under
`libcxxabi`, it cannot directly reference the `LLVM_`-prefixed macros so
we define `DEMANGLE_`-prefixed aliases.

## Validation
* Built llvm-project on Windows with `clang-cl` and MSVC `cl`.
* Built llvm-project on Linux with `clang` and `gcc`.
@andrurogerz
Copy link
Contributor Author

Is there another way you can land this commit w/o creating a cycle?

I don't think so, but this change was just cleanup so I will revert it.

andrurogerz added a commit to andrurogerz/llvm-project that referenced this pull request Jul 23, 2025
rupprecht pushed a commit that referenced this pull request Jul 23, 2025
Reverts #149163 because it introduced a layering
violation.

Support depends on Demangle:

[llvm-project/llvm/lib/Support/Unix/Signals.inc](https://github.com/llvm/llvm-project/blob/324773e238026c5d4f501213678a89bf411e1509/llvm/lib/Support/Unix/Signals.inc#L38)

Line 38 in
[324773e](324773e)
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 23, 2025
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
## Purpose
Simplify `DEMANGLE_` macro definitions in
`llvm/Demangle/DemangleConfig.h` for clarity/maintainability.

## Overview
* Alias `DEMANGLE_DUMP_METHOD`, `DEMANGLE_FALLTHROUGH`, and
`DEMANGLE_UNREACHABLE` macros to their `LLVM_` counterparts defined in
`llvm/Support/Compiler.h`
* Remove several `DEMANGLE_`-prefixed macros that were only used within
`DemangleConfig.h`

## Background
* It should be safe for the `Demangle` component library to depend on
`Support`, so there is no need for it to maintain copies of macros
defined in `llvm/Support/Compiler.h`.
* Since the canonical copy `llvm/Demangle/ItaniumDemangle.h` lives under
`libcxxabi`, it cannot directly reference the `LLVM_`-prefixed macros so
we define `DEMANGLE_`-prefixed aliases.

## Validation
* Built llvm-project on Windows with `clang-cl` and MSVC `cl`.
* Built llvm-project on Linux with `clang` and `gcc`.
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
Reverts llvm#149163 because it introduced a layering
violation.

Support depends on Demangle:

[llvm-project/llvm/lib/Support/Unix/Signals.inc](https://github.com/llvm/llvm-project/blob/324773e238026c5d4f501213678a89bf411e1509/llvm/lib/Support/Unix/Signals.inc#L38)

Line 38 in
[324773e](llvm@324773e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants