[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-04-29 Thread Alexander Richardson via cfe-commits
@@ -0,0 +1,288 @@ +// RUN: %clang_cc1 %s -triple=spirv64-unknown-unknown -fsycl-is-device -std=c++11 -emit-llvm -o %t.ll -O1 -disable-llvm-passes -fms-extensions -fstrict-vtable-pointers +// FIXME: Assume load should not require -fstrict-vtable-pointers + +// RUN: FileCheck --ch

[clang] [clang-tools-extra] [lldb] [llvm] [NFC] Prefer subprocess.DEVNULL over os.devnull (PR #106500)

2024-08-30 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/106500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-02 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. Would be good to fold clang/test/CodeGenCXX/vtable-assume-load-nonzero-default-address-space.cpp into one of the files it was copied from, otherwise LGTM. https://github.com/llvm/llvm-project/pull/88182

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-02 Thread Alexander Richardson via cfe-commits
@@ -0,0 +1,288 @@ +// RUN: %clang_cc1 %s -triple=spirv64-unknown-unknown -fsycl-is-device -std=c++11 -emit-llvm -o %t.ll -O1 -disable-llvm-passes -fms-extensions -fstrict-vtable-pointers +// FIXME: Assume load should not require -fstrict-vtable-pointers + +// RUN: FileCheck --ch

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-14 Thread Alexander Richardson via cfe-commits
@@ -1,14 +1,17 @@ // RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -std=c++11 -emit-llvm -o %t.ll -O1 -disable-llvm-passes -fms-extensions -fstrict-vtable-pointers +// RUN: %clang_cc1 %s -triple i686-pc-win32 -emit-llvm -o %t.ms.ll -O1 -disable-llvm-passes -fms-extensions -fstri

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-14 Thread Alexander Richardson via cfe-commits
@@ -23,8 +26,8 @@ struct B : A { void g(A *a) { a->foo(); } // CHECK1-LABEL: define{{.*}} void @_ZN5test14fooAEv() -// CHECK1: call void @_ZN5test11AC1Ev(ptr -// CHECK1: %[[VTABLE:.*]] = load ptr addrspace(1), ptr %{{.*}} +// CHECK1: call{{.*}} void @_ZN5test11AC1Ev(ptr {{((ad

[clang] [Clang] Use private address space for builtin_alloca return type for OpenCL (PR #95750)

2024-08-02 Thread Alexander Richardson via cfe-commits
@@ -2210,6 +,9 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI__builtin_alloca_uninitialized: Diag(TheCall->getBeginLoc(), diag::warn_alloca) << TheCall->getDirectCallee(); +if (getLangOpts().OpenCL) { + bu

[clang] [CodeGen][NFCI] Don't re-implement parts of ASTContext::getIntWidth (PR #101765)

2024-08-03 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/101765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen][NFCI] Don't re-implement parts of ASTContext::getIntWidth (PR #101765)

2024-08-06 Thread Alexander Richardson via cfe-commits
arichardson wrote: I just had another look at ASTContext::getIntWidth() and the logic there results in the same value being returned, so this should be a NFC change. ``` unsigned ASTContext::getIntWidth(QualType T) const { if (const auto *ET = T->getAs()) T = ET->getDecl()->getIntegerType

[libunwind] [libunwind] Detect cycles of length 1 (PR #103476)

2024-08-20 Thread Alexander Richardson via cfe-commits
arichardson wrote: Are you able to insert a `.cfi_undefined ` in the generated assembly? That would tell libunwind to stop unwinding and is cleaner than this workaround IMO. I just noticed a similar problem in FreeBSD's startup files but I plan to fix those in FreeBSD instead of working aroun

[clang] [CodeGen] Create IFUNCs in the program address space, not hard-coded 0 (PR #105726)

2024-08-22 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/105726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][ISelLowering] Support -mstack-protector-guard=tls (PR #110928)

2024-10-07 Thread Alexander Richardson via cfe-commits
@@ -5616,6 +5616,10 @@ class TargetLowering : public TargetLoweringBase { return true; } +protected: + // Simple interface for targets without a Module dependency arichardson wrote: There probably aren't that many overrides here? Maybe easiest to just

[clang] [llvm] [PowerPC][ISelLowering] Support -mstack-protector-guard=tls (PR #110928)

2024-10-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. This LGTM but would be good to have someone who actually knows PPC to also review it. https://github.com/llvm/llvm-project/pull/110928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-07 Thread Alexander Richardson via cfe-commits
@@ -10,15 +10,13 @@ // //===--===// +// clang-format off arichardson wrote: Why is this needed? Adding another newline should avoid the reordering. Alternatively, config.h should include st

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-07 Thread Alexander Richardson via cfe-commits
@@ -6,7 +6,7 @@ #include "../assembly.h" -#ifdef __aarch64__ +#if defined(__aarch64__) && __ARM_FP != 0 arichardson wrote: Unless I've missed something, only memset uses the q registers? So memcpy should still be fine? https://github.com/llvm/llvm-project/

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson commented: libunwind changes LGTM, not quite sure about the compiler-rt part. https://github.com/llvm/llvm-project/pull/111235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-10 Thread Alexander Richardson via cfe-commits
@@ -238,7 +236,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(__arm_sc_memcpy) DEFINE_COMPILERRT_FUNCTION_ALIAS(__arm_sc_memmove, __arm_sc_memcpy) - +// This version uses FP registers. Use this only on targets with them +#if defined(__aarch64__) && __ARM_FP != 0 aricha

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-10 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/111235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-10 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. LGTM, just one comment. https://github.com/llvm/llvm-project/pull/111235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-10 Thread Alexander Richardson via cfe-commits
@@ -238,7 +236,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(__arm_sc_memcpy) DEFINE_COMPILERRT_FUNCTION_ALIAS(__arm_sc_memmove, __arm_sc_memcpy) - +// This version uses FP registers. Use this only on targets with them +#if defined(__aarch64__) && __ARM_FP != 0 aricha

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-29 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. There are tons of unrelated changes that make this really hard to review. Please do the formatting part of the changes separately and address the outstanding comments. https://github.com/llvm/llvm-project/pull/79667 ___

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-11-04 Thread Alexander Richardson via cfe-commits
@@ -238,7 +236,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(__arm_sc_memcpy) DEFINE_COMPILERRT_FUNCTION_ALIAS(__arm_sc_memmove, __arm_sc_memcpy) - +// This version uses FP registers. Use this only on targets with them +#if defined(__aarch64__) && __ARM_FP != 0 aricha

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-11-12 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/115967 This matches GCC. Partially fixes https://github.com/llvm/llvm-project/pull/115964 >From e428a45e9638d0d310bd21e46acf4175b09815c9 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 12 Nov 2024 16:2

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-12 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/115964 >From 712bbc59b1976a35c8aba4bdea8728d7e9f2b425 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 12 Nov 2024 16:02:17 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?

[clang] [CSKY] Default to unsigned char (PR #115961)

2024-11-12 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/115961 This matches the ABI document found at https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf Partially addresses https://github.com/llvm/llvm-project/i

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-12 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/115964 This matches the ABI document at https://www.ti.com/lit/pdf/slaa534 as well as the GCC implementation. Partially fixes https://github.com/llvm/llvm-project/issues/115957. >From 712bbc59b1976a35c8aba4bdea87

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-12 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/115964 >From 712bbc59b1976a35c8aba4bdea8728d7e9f2b425 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 12 Nov 2024 16:02:17 -0800 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-11-13 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/115967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [mlir] [IR] Introduce `T` to `DataLayout` to represent flat address space if a target supports it (PR #108786)

2024-09-18 Thread Alexander Richardson via cfe-commits
@@ -245,6 +246,7 @@ class DataLayout { unsigned getDefaultGlobalsAddressSpace() const { return DefaultGlobalsAddrSpace; } + unsigned getFlatAddressSpace() const { return FlatAddressSpace; } arichardson wrote: I don't think this is a good API - returni

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-01 Thread Alexander Richardson via cfe-commits
@@ -29,22 +29,21 @@ namespace __cxxabiv1 { +#if defined(__wasm__) +typedef void* (*__libcpp_exception_destructor_func)(void*); arichardson wrote: Could keep the existing comment here `// In Wasm, a destructor returns its argument` to explain why it is d

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-01 Thread Alexander Richardson via cfe-commits
@@ -98,73 +89,58 @@ extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_pure_virtual(void); extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void); // 3.3.2 One-time Construction API -#if defined(_LIBCXXABI_GUARD_ABI_ARM) -extern _LIBCXXABI_FUN

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-01 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson commented: I started reviewing this but all the unrelated formatting changes made this quite difficult. Would appreciate a minimal diff with just the changes that are needed for WASM. https://github.com/llvm/llvm-project/pull/79667 ___

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-10-01 Thread Alexander Richardson via cfe-commits
@@ -12,7 +12,7 @@ // functions. We need to ensure that the return value is sign-extended in the // same way as GCC expects (since otherwise GCC-generated __builtin_isinf // returns true for finite 128-bit floating-point numbers). -#ifdef __aarch64__ +#if defined(__aarch64__) ||

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-11-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/111235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Fix compilation for the x32 ABI. (PR #116608)

2024-11-20 Thread Alexander Richardson via cfe-commits
arichardson wrote: > > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > Ok, but this is just clearly silly given the surrounding code. Yes I would ignore this. This change looks reasonable to me. I have no experience with the x32 parts of libunwind, but if it fixes the

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-11-23 Thread Alexander Richardson via cfe-commits
arichardson wrote: Could you address the raised issues instead of constantly updating the branch? This wastes CI resources and spams everyone subscribed to this PR. Please feel free to reopen it once you have addressed the issues. https://github.com/llvm/llvm-project/pull/79667 ___

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-11-23 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/79667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Alexander Richardson via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Alexander Richardson via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { arichardson wrote: Shou

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-12-02 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/115967 >From e428a45e9638d0d310bd21e46acf4175b09815c9 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 12 Nov 2024 16:24:08 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-12-02 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/115967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-12-02 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/115967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-12-02 Thread Alexander Richardson via cfe-commits
arichardson wrote: Looking at https://github.com/llvm/llvm-project/pull/118008 it sounds like we don't yet have complete codegen support for XTensa in Clang, so it sounds like this is safe without a flag. https://github.com/llvm/llvm-project/pull/115967

[clang] [CSKY] Default to unsigned char (PR #115961)

2024-12-02 Thread Alexander Richardson via cfe-commits
arichardson wrote: ping https://github.com/llvm/llvm-project/pull/115961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Xtensa] Default to unsigned char (PR #115967)

2024-12-01 Thread Alexander Richardson via cfe-commits
arichardson wrote: > Hi @arichardson. > > Thanks for this change. Acc to the doc which I have `The char type is > unsigned by default for Xtensa processors.` Our GCC Xtensa toolchain also > interprets char type as unsigned by default. Thanks, do you believe we need a backwards compatibility f

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-06 Thread Alexander Richardson via cfe-commits
arichardson wrote: Could you give me an example of such an architecture? Isn't it a bug that clang reports an incorrect mangled name? Also please add a test for this (ideally pre-committing one that fails before and passes with this change). https://github.com/llvm/llvm-project/pull/121800 ___

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-06 Thread Alexander Richardson via cfe-commits
@@ -650,6 +655,16 @@ def get_triple_from_march(march): print("Cannot find a triple. Assume 'x86'", file=sys.stderr) return "x86" +def get_global_underscores(raw_tool_output): +m = DATA_LAYOUT_RE.search(raw_tool_output) +if not m: +return False +data

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-06 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. Code needs formatting and missing tests. https://github.com/llvm/llvm-project/pull/121800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-07 Thread Alexander Richardson via cfe-commits
@@ -122,6 +122,11 @@ def parse_clang_ast_json(node, loc, search): if search is None: search = spell mangled = node.get("mangledName", spell) +# Strip leading underscore from globals, so the name matches the LLVM one arichard

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: So it looks like this happens to work if we already mapped the function to another mangled name previously which is why the macho happens to work if we generated CHECK lines for ELF already. https://github.com/llvm/llvm-project/pull/121800 ___

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-07 Thread Alexander Richardson via cfe-commits
@@ -650,6 +655,16 @@ def get_triple_from_march(march): print("Cannot find a triple. Assume 'x86'", file=sys.stderr) return "x86" +def get_global_underscores(raw_tool_output): +m = DATA_LAYOUT_RE.search(raw_tool_output) +if not m: +return False +data

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. A few suggestions but this should be good to land once formatting has been fixed and the baseline test is in. I'd also drop the regen of the neon intrinsics from this patch and do that separately. https://github.com/llvm/l

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: I've been looking into this a bit and I can see that this works for for most function but for some reason fails with NEON vector type arguments/return values. Even though the mangled name is identitical. I will pre-commit some tests for this. https://github.com/llvm/llvm-pr

[clang] [update_cc_test_checks] Add test for missing handling of mangled names (PR #121976)

2025-01-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/121976 We are missing MSVC C++ functions since the name is quoted in the LLVM IR, so we don't find them in the generated IR and therefore don't add the test checks. Additionally, there is an issue with finding funct

[clang] [update_cc_test_checks] Add test for missing handling of mangled names (PR #121976)

2025-01-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: @momchil-velikov I've added a baseline test here that should be fixed/improved by your change. https://github.com/llvm/llvm-project/pull/121976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [update_cc_test_checks] Add test for missing handling of mangled names (PR #121976)

2025-01-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: Will merge this once CI is happy. https://github.com/llvm/llvm-project/pull/121976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [update_cc_test_checks] Add test for missing handling of mangled names (PR #121976)

2025-01-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/121976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CSKY] Default to unsigned char (PR #115961)

2024-12-30 Thread Alexander Richardson via cfe-commits
arichardson wrote: @zixuan-wu (or anyone else who knows about CSKY) ping https://github.com/llvm/llvm-project/pull/115961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-07 Thread Alexander Richardson via cfe-commits
@@ -452,12 +452,12 @@ void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, ArgStringList &CmdArgs) const { + Generic_ELF::AddCXXStdlibLibArgs(Args, CmdArgs); unsi

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/126302 The experimental-library-flag.cpp test was failing on FreeBSD builders, which turned to be caused by missing support for -stdlib=libcstdc++ (and just using a hardcoded libc++ in all cases). Simplify FreeBSD::

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/126302 >From 6b89c65eb61a7c2565b96caedd11eb2efff61021 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 7 Feb 2025 12:14:20 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-07 Thread Alexander Richardson via cfe-commits
@@ -452,12 +452,12 @@ void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, ArgStringList &CmdArgs) const { + Generic_ELF::AddCXXStdlibLibArgs(Args, CmdArgs); unsi

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-07 Thread Alexander Richardson via cfe-commits
@@ -452,12 +452,12 @@ void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, ArgStringList &CmdArgs) const { + Generic_ELF::AddCXXStdlibLibArgs(Args, CmdArgs); unsi

[clang] [CSKY] Default to unsigned char (PR #115961)

2025-02-08 Thread Alexander Richardson via cfe-commits
arichardson wrote: > LGTM. But I think commit msg should be refined(this PR is not for > upstreaming?) Thanks for reviewing! Sorry what do you mean by commit message needs to be refined? I created this using the spr tool and when merging the description of the PR will be used. Is there someth

[clang] [CSKY] Default to unsigned char (PR #115961)

2025-02-09 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/115961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-10 Thread Alexander Richardson via cfe-commits
arichardson wrote: > It's not missing as in like someone forgot. It is intentional. Same goes for > FreeBSD and OpenBSD's Drivers. The base OS uses libc++ and anything else is > not supported. You can install it from ports though and it should be possible to use that? https://github.com/llvm/

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-11 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson commented: I had to do something very similar for CHERI downstream: We have to ensure that all globals are precisely representable (which may require rounding up the size+alignment) so you don't end up creating bounds that include adjacent ones. The original patch

[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

2024-12-12 Thread Alexander Richardson via cfe-commits
@@ -808,6 +808,10 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) { "visibility must be dso_local!", &GV); + if (GV.isTagged()) { arichardson wrote: Back in 2019 or so we had very similar issues in the CHERI downstream due to k

[libunwind] [Libunwind] Try to fix msan failures (PR #120013)

2024-12-17 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/120013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [Libunwind] Try to fix msan failures (PR #120013)

2024-12-17 Thread Alexander Richardson via cfe-commits
@@ -133,6 +133,10 @@ _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { unw_cursor_t cursor; unw_context_t uc; +#if __has_feature(memory_sanitizer) + __builtin_memset(&cursor, 0, sizeof(cursor)); arichardson wro

[libunwind] [Libunwind] Try to fix msan failures (PR #120013)

2024-12-17 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. We shouldn't need to initialize these structures to silence sanitizer errors. I had a draft pr last year to fix this properly but forgot about it since other things came up: https://github.com/llvm/llvm-project/pull/67860 I

[clang] [CSKY] Default to unsigned char (PR #115961)

2025-01-21 Thread Alexander Richardson via cfe-commits
arichardson wrote: ping https://github.com/llvm/llvm-project/pull/115961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-12 Thread Alexander Richardson via cfe-commits
@@ -122,6 +122,14 @@ def parse_clang_ast_json(node, loc, search): if search is None: search = spell mangled = node.get("mangledName", spell) +# Clang's AST dump includes the globals prefix, but when Clang emits +# LLVM IR this is not

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-10 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. Thanks this LGTM https://github.com/llvm/llvm-project/pull/121800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-15 Thread Alexander Richardson via cfe-commits
arichardson wrote: ping, is this ok to merge? https://github.com/llvm/llvm-project/pull/126302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-16 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/126302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-16 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/126302 >From 6b89c65eb61a7c2565b96caedd11eb2efff61021 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 7 Feb 2025 12:14:20 -0800 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-16 Thread Alexander Richardson via cfe-commits
@@ -1,9 +1,13 @@ // RUN: %clangxx %s -### -o %t.o --target=amd64-unknown-freebsd -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s // RUN: %clangxx %s -### -o %t.o --target=amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \ -// RUN: | FileCheck --

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-16 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/126302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FreeBSD] Support -stdlib=libstdc++ (PR #126302)

2025-02-16 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/126302 >From 6b89c65eb61a7c2565b96caedd11eb2efff61021 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 7 Feb 2025 12:14:20 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
@@ -381,24 +381,22 @@ typename A::pint_t DwarfInstructions::evaluateExpression(pint_t expression, A &addressSpace, const R ®isters, pint_t initialStackValue) { - const bool log = false;

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson commented: This looks like a nice improvement. Some minor questions inline https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
@@ -223,6 +221,41 @@ } while (0) #endif +#define _LIBUNWIND_TRACING_COMPACT_UNWIND (0) +#if !_LIBUNWIND_TRACING_COMPACT_UNWIND +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0(msg) +#define _LIBUNWIND_TRACE_COMPACT_UNWIND(msg, ...) +#else +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
@@ -223,6 +221,41 @@ } while (0) #endif +#define _LIBUNWIND_TRACING_COMPACT_UNWIND (0) +#if !_LIBUNWIND_TRACING_COMPACT_UNWIND +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0(msg) +#define _LIBUNWIND_TRACE_COMPACT_UNWIND(msg, ...) +#else +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-02-18 Thread Alexander Richardson via cfe-commits
@@ -223,6 +221,41 @@ } while (0) #endif +#define _LIBUNWIND_TRACING_COMPACT_UNWIND (0) +#if !_LIBUNWIND_TRACING_COMPACT_UNWIND +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0(msg) +#define _LIBUNWIND_TRACE_COMPACT_UNWIND(msg, ...) +#else +#define _LIBUNWIND_TRACE_COMPACT_UNWIND0

[clang] [clang-format] Add the C language instead of treating it like C++ (PR #128287)

2025-02-27 Thread Alexander Richardson via cfe-commits
@@ -3957,7 +3958,12 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) { LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; LangOpts.LineComment = 1; - LangOpts.CXXOperatorNames = Style.isCpp(); + + const auto Language = Style.Language; + LangOpts.C17

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-03-07 Thread Alexander Richardson via cfe-commits
arichardson wrote: > @arichardson as promised, I have rebased the changes. I'm not sure about the > test failures, it would seem to me that they are unlikely to be caused by > anything I did? Yes it looks like an issue with the android CI setup, nothing related to this patch I believe. https

[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)

2025-03-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][RISCV] Make asm statement volatile (PR #130286)

2025-03-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/130286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-07 Thread Alexander Richardson via cfe-commits
@@ -715,8 +715,16 @@ MCSymbol *AsmPrinter::getSymbolPreferLocal(const GlobalValue &GV) const { return TM.getSymbol(&GV); } -/// EmitGlobalVariable - Emit the specified global variable to the .s file. void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { + MaybeA

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Alexander Richardson via cfe-commits
@@ -715,8 +715,16 @@ MCSymbol *AsmPrinter::getSymbolPreferLocal(const GlobalValue &GV) const { return TM.getSymbol(&GV); } -/// EmitGlobalVariable - Emit the specified global variable to the .s file. void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { + MaybeA

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. This looks good to me and it should be possible to use this for CHERI downstream as well. https://github.com/llvm/llvm-project/pull/121957 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

2025-03-06 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/121957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [lldb] [llvm] [compiler-rt] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #131200)

2025-03-13 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/131200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-20 Thread Alexander Richardson via cfe-commits
arichardson wrote: This makes a lot of sense to me, just wondering why you chose `clang/lib/CodeGen/BuiltinTargets/` rather than `clang/lib/CodeGen/TargetBuiltins/`? The former shounds like it contains the list of all builtin targets, rather than the codegen for target-specific builtins. htt

<    1   2   3   4   >