[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-10-07 Thread Rainer Orth via cfe-commits
https://github.com/rorth updated https://github.com/llvm/llvm-project/pull/106353 >From 646c6ad032fe9c15faee03246496958f7592ea75 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Wed, 28 Aug 2024 11:24:29 +0200 Subject: [PATCH 1/3] [WIP][clang] Fix std::tm etc. mangling on Solaris Recently, Sol

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-10-07 Thread Rainer Orth via cfe-commits
rorth wrote: > > just leads to infinite recursion (obviously), > > Try casting the pointer to uintptr_t? That just created a total mess, unfortunately, like duplicating args or dropping the `*` from `char const *`. > Might be simpler to mess with CXXNameMangler::mangleUnscopedName, though, >

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-10-01 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > just leads to infinite recursion (obviously), Try casting the pointer to uintptr_t? --- Might be simpler to mess with CXXNameMangler::mangleUnscopedName, though, which I think is where the St prefix is getting added. https://github.com/llvm/llvm-project/pull/106353

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-09-27 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The code assumes standard substitutions are not themselves substitutable. So you probably need to call mangleSubstitution/addSubstitution explicitly in the code. mangleSubstitution checks if there's an existing substitution, addSubstitution appends to the list of substi

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-09-27 Thread Rainer Orth via cfe-commits
rorth wrote: Incorporate review comments. However, I still have a mis-mangling of the code that triggered this patch. I've now been able to create a reduced example: ``` namespace std { extern "C" { struct tm { int tm_sec; }; } } using std::tm; void func (std::tm tm, const

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-09-27 Thread Rainer Orth via cfe-commits
https://github.com/rorth updated https://github.com/llvm/llvm-project/pull/106353 >From 646c6ad032fe9c15faee03246496958f7592ea75 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Wed, 28 Aug 2024 11:24:29 +0200 Subject: [PATCH 1/2] [WIP][clang] Fix std::tm etc. mangling on Solaris Recently, Sol

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
rorth wrote: > clang/docs/ReleaseNotes.rst Ah, that. I was thinking of the GNU style `ChangeLog` files. Done locally; will push once the remaining mangling error has been fleshed out. https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
cor3ntin wrote: > > Can you also add a changelog entry? Thanks! > > I've never seen them used in LLVM. Has that changed recently? Checkout `clang/docs/ReleaseNotes.rst` https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cf

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
rorth wrote: > Can you also add a changelog entry? Thanks! I've never seen them used in LLVM. Has that changed recently? https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
@@ -6953,6 +6954,27 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { return false; } + if (getASTContext().getTargetInfo().getTriple().isOSSolaris()) { +if (const RecordDecl *RD = dyn_cast(ND)) { + if (!isStdNamespace(Context.getEffect

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
@@ -1604,10 +1604,12 @@ static bool isTargetVariantEnvironment(const TargetInfo &TI, return false; } -#if defined(__sun__) && defined(__svr4__) +#if defined(__sun__) && defined(__svr4__) && defined(__clang__) && \ +__clang__ < 20 rorth wrot

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
@@ -6953,6 +6954,27 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { return false; } + if (getASTContext().getTargetInfo().getTriple().isOSSolaris()) { +if (const RecordDecl *RD = dyn_cast(ND)) { + if (!isStdNamespace(Context.getEffect

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
@@ -1604,10 +1604,12 @@ static bool isTargetVariantEnvironment(const TargetInfo &TI, return false; } -#if defined(__sun__) && defined(__svr4__) +#if defined(__sun__) && defined(__svr4__) && defined(__clang__) && \ +__clang__ < 20 cor3ntin w

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
https://github.com/cor3ntin commented: Can you also add a changelog entry? Thanks! https://github.com/llvm/llvm-project/pull/106353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Rainer Orth (rorth) Changes Recently, Solaris bootstrap got broken because Solaris uses a non-standard mangling of `std::tm` and a few others. This was fixed with a hack in PR Solaris ABI requirements, mangling `std::tm` as `tm` and simi

[clang] [WIP][clang] Fix std::tm etc. mangling on Solaris (PR #106353)

2024-08-28 Thread Rainer Orth via cfe-commits
https://github.com/rorth created https://github.com/llvm/llvm-project/pull/106353 Recently, Solaris bootstrap got broken because Solaris uses a non-standard mangling of `std::tm` and a few others. This was fixed with a hack in PR Solaris ABI requirements, mangling `std::tm` as `tm` and simila