Skip to content

Revert "[llvm] simplify and clean-up DemangleConfig.h" #150160

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 23, 2025

Conversation

andrurogerz
Copy link
Contributor

Reverts #149163 because it introduced a layering violation.

Support depends on Demangle:
llvm-project/llvm/lib/Support/Unix/Signals.inc

Line 38 in 324773e

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions h -- llvm/include/llvm/Demangle/DemangleConfig.h
View the diff from clang-format here.
diff --git a/llvm/include/llvm/Demangle/DemangleConfig.h b/llvm/include/llvm/Demangle/DemangleConfig.h
index 30f72ffe0..29efa6a8d 100644
--- a/llvm/include/llvm/Demangle/DemangleConfig.h
+++ b/llvm/include/llvm/Demangle/DemangleConfig.h
@@ -33,11 +33,11 @@
 
 #ifndef DEMANGLE_GNUC_PREREQ
 #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-#define DEMANGLE_GNUC_PREREQ(maj, min, patch)                           \
+#define DEMANGLE_GNUC_PREREQ(maj, min, patch)                                  \
   ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >=          \
    ((maj) << 20) + ((min) << 10) + (patch))
 #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
-#define DEMANGLE_GNUC_PREREQ(maj, min, patch)                           \
+#define DEMANGLE_GNUC_PREREQ(maj, min, patch)                                  \
   ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10))
 #else
 #define DEMANGLE_GNUC_PREREQ(maj, min, patch) 0

@rupprecht rupprecht self-requested a review July 23, 2025 04:07
Copy link
Collaborator

@rupprecht rupprecht left a comment

Choose a reason for hiding this comment

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

Thanks!

@rupprecht rupprecht merged commit 0eafc73 into llvm:main Jul 23, 2025
9 of 10 checks passed
@andrurogerz andrurogerz deleted the revert-149163-llvm-demangle-config branch July 23, 2025 14:46
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 23, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/23083

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/WebAssembly/ref-test-func.ll' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll --mtriple=wasm32-unknown-unknown -mcpu=mvp -mattr=+reference-types | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck --check-prefixes CHECK,CHK32 /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll # RUN: at line 2
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc --mtriple=wasm32-unknown-unknown -mcpu=mvp -mattr=+reference-types
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck --check-prefixes CHECK,CHK32 /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll --mtriple=wasm64-unknown-unknown -mcpu=mvp -mattr=+reference-types | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck --check-prefixes CHECK,CHK64 /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll # RUN: at line 3
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc --mtriple=wasm64-unknown-unknown -mcpu=mvp -mattr=+reference-types
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck --check-prefixes CHECK,CHK64 /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/WebAssembly/ref-test-func.ll

# After Post-RA pseudo instruction expansion pass
# Machine code for function test_fpsig_void_void: NoPHIs, TracksLiveness, TiedOpsRewritten
Function Live Ins: $arguments

bb.0.entry:
  liveins: $arguments
  %0:i64 = ARGUMENT_i64 0, implicit $arguments
  %2:i32 = COPY_I32 %0:i64, implicit-def $arguments
  %1:funcref = TABLE_GET_FUNCREF <mcsymbol __indirect_function_table>, %2:i32, implicit-def dead $arguments
  %3:i32 = REF_TEST_FUNCREF i128 2475880060124016476088696832, %1:funcref, implicit-def dead $arguments
  CALL @use, %3:i32, implicit-def dead $arguments, implicit $sp32, implicit $sp64, implicit-def dead $arguments, implicit $sp32, implicit $sp64
  RETURN implicit-def dead $arguments

# End machine code for function test_fpsig_void_void.

*** Bad machine code: Illegal virtual register for instruction ***
- function:    test_fpsig_void_void
- basic block: %bb.0 entry (0xa293320)
- instruction: %2:i32 = COPY_I32 %0:i64, implicit-def $arguments
- operand 1:   %0:i64
Expected a I32 register, but got a I64 register
LLVM ERROR: Found 1 machine code errors.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc --mtriple=wasm64-unknown-unknown -mcpu=mvp -mattr=+reference-types
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Verify generated machine code' on function '@test_fpsig_void_void'
 #0 0x00000000039890b7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x39890b7)
 #1 0x0000000003986825 llvm::sys::RunSignalHandlers() (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x3986825)
 #2 0x0000000003989dea SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f24ff4e9140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13140)
 #4 0x00007f24feffdd61 raise (/lib/x86_64-linux-gnu/libc.so.6+0x38d61)
 #5 0x00007f24fefe7537 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22537)
 #6 0x00000000038f170d llvm::report_fatal_error(llvm::Twine const&, bool) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x38f170d)
 #7 0x0000000002b56b7d (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x2b56b7d)
 #8 0x0000000002b57bdb (anonymous namespace)::MachineVerifierLegacyPass::runOnMachineFunction(llvm::MachineFunction&) MachineVerifier.cpp:0:0
 #9 0x0000000002a4d4c3 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x2a4d4c3)
#10 0x0000000002fbf613 llvm::FPPassManager::runOnFunction(llvm::Function&) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc+0x2fbf613)
...

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.

3 participants