[clang] [PAC][clang] Enhance preprocessor ptrauth tests (PR #98862)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Daniil Kovalev (kovdan01) Changes Test one feature at a time to make RUN lines shorter. See also https://github.com/llvm/llvm-project/pull/96992#discussion_r1669394582 --- Full diff: https://github.com/llvm/llvm-project/pull/98862.diff

[clang] [PAC][clang] Enhance preprocessor ptrauth tests (PR #98862)

2024-07-14 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/98862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Enhance preprocessor ptrauth tests (PR #98862)

2024-07-14 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/98862 Test one feature at a time to make RUN lines shorter. See also https://github.com/llvm/llvm-project/pull/96992#discussion_r1669394582 >From 9436a51f2545434da511c4421099f7501a5472c5 Mon Sep 17 00:00:00 2001 From

[clang] [clang] Refactor: Move CTAD code from SemaTemplate.cpp to a dedicated file, NFC (PR #98524)

2024-07-14 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/98524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Dmitriy Chestnykh via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang -fsyntax-only -S %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM +// RUN: %clang -fsyntax-only -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-OBJ +// RUN: %clang -fsyntax-only -S -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOTH + +// CHECK-ASM:

[clang-tools-extra] [clang-doc] Improve performance by adding a short circuit (PR #96809)

2024-07-14 Thread via cfe-commits
PeterChou1 wrote: > > Ok nevermind, disregard the above comment I was wrong about the mechanism > > of the bug. the source of this bug comes from the way clang-doc handles C > > code, particularly anonymous typedef in C. When clang-doc encounters an > > anonymous typedef in C it incorrectly se

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Dmitriy Chestnykh via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang -fsyntax-only -S %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM chestnykh wrote: Renamed https://github.com/llvm/llvm-project/pull/98607 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Dmitriy Chestnykh via cfe-commits
https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/98607 >From ae43fc67b7d9db848ec8c4ecbcab1db6af7fcb01 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Fri, 12 Jul 2024 12:25:16 +0300 Subject: [PATCH 1/3] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only`

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Dmitriy Chestnykh via cfe-commits
https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/98607 >From ae43fc67b7d9db848ec8c4ecbcab1db6af7fcb01 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Fri, 12 Jul 2024 12:25:16 +0300 Subject: [PATCH 1/2] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only`

[clang] [clang] Use different memory layout type for _BitInt(N) in LLVM IR (PR #91364)

2024-07-14 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: > Mariya, would you mind looking into setting this properly on the truncates > we're doing here? It'd be fine to do that as a follow-up; no need to hold up > this PR for it. You'll need some kind of target hook to tell us whether to > set it or not. Probably that ought to go i

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang -fsyntax-only -S %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM MaskRay wrote: Perhaps just warn-fsyntax-only.c https://github.com/llvm/llvm-project/pull/98607 ___ cfe-commits mailing l

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang -fsyntax-only -S %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM +// RUN: %clang -fsyntax-only -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-OBJ +// RUN: %clang -fsyntax-only -S -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOTH + +// CHECK-ASM:

[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -794,10 +794,6 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C, Args.hasArg(options::OPT_coverage)) FProfileDir = Args.getLastArg(options::OPT_fprofile_dir); - // TODO: Don't claim -c/-S to warn about -fsyntax-only -c/-S, -E -c/-S,

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-14 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,119 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-14 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,119 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang-tools-extra] [clang-doc] Support markdown and simplify checks (PR #97684)

2024-07-14 Thread via cfe-commits
https://github.com/PeterChou1 closed https://github.com/llvm/llvm-project/pull/97684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 37211d1 - [clang-doc] Support markdown and simplify checks (#97684)

2024-07-14 Thread via cfe-commits
Author: PeterChou1 Date: 2024-07-15T02:08:01-04:00 New Revision: 37211d17f9f237e8a820ed81c1b5e92c22b45d5e URL: https://github.com/llvm/llvm-project/commit/37211d17f9f237e8a820ed81c1b5e92c22b45d5e DIFF: https://github.com/llvm/llvm-project/commit/37211d17f9f237e8a820ed81c1b5e92c22b45d5e.diff LO

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
owenca wrote: > Are there tests for #98820? I've added a test case. https://github.com/llvm/llvm-project/pull/98849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/98849 >From 24f3b4f03f217e578aa2a2585d7d1742b7d7c09b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 14 Jul 2024 17:52:23 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in SpaceBeforeParensOptions Handle constr

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -125,6 +137,26 @@ class TypeDescriptor { return 1 << (TypeInfo >> 1); } + const char *getBitIntBitCountPointer() const { +CHECK(isBitIntTy()); +CHECK(isSignedBitIntTy()); +// Scan Name for zero and return the next address +const char *p = getTypeName(

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -125,6 +137,26 @@ class TypeDescriptor { return 1 << (TypeInfo >> 1); } + const char *getBitIntBitCountPointer() const { +CHECK(isBitIntTy()); MaskRay wrote: CHECK unconditionally compiles to additional code. perhaps DCHECK https://github.com/

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -3298,22 +3315,40 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) { /// { i16 TypeKind, i16 TypeInfo } /// \endcode /// -/// followed by an array of i8 containing the type name. TypeKind is 0 for an -/// integer, 1 for a floating point value, and

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -3298,22 +3315,40 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) { /// { i16 TypeKind, i16 TypeInfo } /// \endcode /// -/// followed by an array of i8 containing the type name. TypeKind is 0 for an -/// integer, 1 for a floating point value, and

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -3324,6 +3359,20 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) { DiagnosticsEngine::ak_qualtype, (intptr_t)T.getAsOpaquePtr(), StringRef(), StringRef(), std::nullopt, Buffer, std::nullopt); + if (IsBitInt) { +// The Structure is:

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. https://github.com/llvm/llvm-project/pull/96240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/96240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/94352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/20] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Yingwei Zheng via cfe-commits
@@ -290,8 +290,24 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args, // 2. Get march (isa string) based on `-mcpu=` if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "native") +if (CPU == "nat

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %clang -Wno-constant-conversion -Wno-array-bounds -Wno-division-by-zero -Wno-shift-negative-value -Wno-shift-count-negative -Wno-int-to-pointer-cast -O0 -fsanitize=alignment,array-bounds,bool,float-cast-overflow,implicit-integer-sign-change,implicit-si

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Pengcheng Wang via cfe-commits
@@ -290,8 +290,24 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args, // 2. Get march (isa string) based on `-mcpu=` if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "native") +if (CPU == "nat

[clang] [llvm] [APFloat] Add support for f8E4M3 IEEE 754 type (PR #97179)

2024-07-14 Thread Alexander Pivovarov via cfe-commits
apivovarov wrote: Hi @tschuett, @arsenm I wanted to kindly request your review on this f8E4M3 PR when you have a moment. https://github.com/llvm/llvm-project/pull/97179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [RISCV] Allow YAML file to control multilib selection (PR #98856)

2024-07-14 Thread via cfe-commits
ArcaneNibble wrote: CI fail appears spurious/unrelated ``` _bk;t=1721016690369Failed Tests (1): _bk;t=1721016690369 LLVM :: CodeGen/AMDGPU/fix-wwm-vgpr-copy.ll ``` https://github.com/llvm/llvm-project/pull/98856 ___ cfe-commits mailing list cfe-

[clang] [RISCV] Allow YAML file to control multilib selection (PR #98856)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: R (ArcaneNibble) Changes This changes the bare-metal driver logic such that it _always_ tries multilib.yaml if it exists, and it falls back to the hardwired/default RISC-V multilib selection only if a mul

[clang] [RISCV] Allow YAML file to control multilib selection (PR #98856)

2024-07-14 Thread via cfe-commits
https://github.com/ArcaneNibble created https://github.com/llvm/llvm-project/pull/98856 This changes the bare-metal driver logic such that it _always_ tries multilib.yaml if it exists, and it falls back to the hardwired/default RISC-V multilib selection only if a multilib.yaml doesn't exist. I

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Akira Hatanaka (ahatanak) Changes Re-signing occurs when function type discrimination is enabled and a function pointer is converted to another function pointer type that requires signing using a different discriminator. A functio

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak ready_for_review https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Implement function pointer re-signing (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Resign function pointer (PR #98847)

2024-07-14 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak edited https://github.com/llvm/llvm-project/pull/98847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [RISCV] Allow libunwind to build for rv32e (PR #98855)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: R (ArcaneNibble) Changes Don't try to save x16-x31 when using rv32e ABI Note that I haven't actually tested yet whether or not unwinding actually works on rv32e, but the code as-is doesn't even build. --- Full diff: https://github.co

[libunwind] [RISCV] Allow libunwind to build for rv32e (PR #98855)

2024-07-14 Thread via cfe-commits
https://github.com/ArcaneNibble created https://github.com/llvm/llvm-project/pull/98855 Don't try to save x16-x31 when using rv32e ABI Note that I haven't actually tested yet whether or not unwinding actually works on rv32e, but the code as-is doesn't even build. >From ae5c879de7d0dca880adcbb

[clang] [clang] Support --sysroot= for ${arch}-windows-msvc targets (PR #96417)

2024-07-14 Thread via cfe-commits
https://github.com/trcrsired updated https://github.com/llvm/llvm-project/pull/96417 >From 76d60474942348985abedc60560e52da61792d93 Mon Sep 17 00:00:00 2001 From: trcrsired Date: Sun, 23 Jun 2024 00:07:19 -0400 Subject: [PATCH] Support --sysroot= for ${arch}-windows-msvc targets I think it is

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Emilia Kond via cfe-commits
rymiel wrote: Are there tests for #98820? https://github.com/llvm/llvm-project/pull/98849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

2024-07-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4ca024c - [Clang] Fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (#96228)

2024-07-14 Thread via cfe-commits
Author: Oleksandr T Date: 2024-07-15T10:00:19+08:00 New Revision: 4ca024c877e3eb20c0af518d3335883fb7b4b910 URL: https://github.com/llvm/llvm-project/commit/4ca024c877e3eb20c0af518d3335883fb7b4b910 DIFF: https://github.com/llvm/llvm-project/commit/4ca024c877e3eb20c0af518d3335883fb7b4b910.diff L

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

2024-07-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "AMDGPU: Move attributor into optimization pipeline (#83131)" and follow up commit "clang/AMDGPU: Defeat attribute optimization in attribute test" (PR #98851)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-clang Author: None (dyung) Changes This reverts commits 677cc15e0ff2e0e6aa30538eb187990a6a8f53c0 and 78bc1b64a6dc3fb6191355a5e1b502be8b3668e7. The test CodeGenHIP/default-attributes.hip is failing on multiple bots e

[clang] [llvm] Revert "AMDGPU: Move attributor into optimization pipeline (#83131)" and follow up commit "clang/AMDGPU: Defeat attribute optimization in attribute test" (PR #98851)

2024-07-14 Thread via cfe-commits
https://github.com/dyung closed https://github.com/llvm/llvm-project/pull/98851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/98849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Allow unnecessary-value-param to match templated functions including lambdas with auto. (PR #97767)

2024-07-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/97767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
whitequark wrote: > Alternatively, perhaps it would be good to stub it out at the pthread API  > level, so that C code is also handled. This is [being discussed in wasi-libc](https://github.com/WebAssembly/wasi-libc/issues/501#issuecomment-2227444912) and might be a good way forward. https://

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
jyknight wrote: > It wasn't clear to me initially what the way forward is, but it seems like > it's not really feasible to conditionalize each use of `std::mutex` and > instead WASI sysroots should provide a single-threaded implementation of > synchronization primitives for embeddings which do

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
https://github.com/jyknight edited https://github.com/llvm/llvm-project/pull/92677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
whitequark wrote: @jyknight Thanks for the review! I will split the stubs off. Regarding threading, there is an unfortunate combination of issues here: 1. The `wasm32-wasip1` target doesn't have e.g. `std::mutex` available at all. This makes it impossible to build LLVM and the amount of conditi

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -508,6 +512,9 @@ static bool is_local_impl(struct STATVFS &Vfs) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) jyknight wrote: It doesn't; C++ compilation only targ

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -41,6 +41,8 @@ using namespace llvm; +#if defined(_WIN32) || !defined(__wasi__) whitequark wrote: `raw_socket_stream` isn't actually used anywhere except for tests, so this doesn't break anything. Should it perhaps be removed instead? https://github.com

[clang] [llvm] [mlir] Remove the `x86_mmx` IR type. (PR #98505)

2024-07-14 Thread Phoebe Wang via cfe-commits
@@ -57594,6 +57599,86 @@ static SDValue combinePDEP(SDNode *N, SelectionDAG &DAG, return SDValue(); } +// Fixup the MMX intrinsics' types: in IR they are expressed with <1 x i64>, phoebewang wrote: Can we use `i64` instead of `<1 x i64>` given we don't car

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -45,8 +45,11 @@ void lld::unlinkAsync(StringRef path) { if (!sys::fs::exists(path) || !sys::fs::is_regular_file(path)) return; +// If threads are disabled, remove the file synchronously. whitequark wrote: I'm sorry, I don't quite understand. Are you

[clang] [llvm] [mlir] Remove the `x86_mmx` IR type. (PR #98505)

2024-07-14 Thread Phoebe Wang via cfe-commits
@@ -1,9 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s -; RUN: verify-uselistorder %s -; Basic smoke test for x86_mmx type. - -; CHECK: define x86_mmx @sh16 phoebewang wrote: Why we removed it instead of update? https://github.com/llvm/llvm-project/pull/

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Handle constructors/destructors for AfterFunctionDeclarationName and AfterFunctionDefinitionName. Fixes #98812. --- Full diff: https://github.com/llvm/llvm-project/pull/98849.diff 2 Files Affected: - (

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/98849 Handle constructors/destructors for AfterFunctionDeclarationName and AfterFunctionDefinitionName. Fixes #98812. >From 24f3b4f03f217e578aa2a2585d7d1742b7d7c09b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun,

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -13,8 +13,17 @@ #include "llvm/Support/Signals.h" #include "llvm/Support/thread.h" #include +#if !defined(__wasi__) +#include +#endif +#if LLVM_ENABLE_THREADS whitequark wrote: I think it actually does work, since I ended up building LLVM always with the

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -94,7 +94,7 @@ static std::error_code getHostID(SmallVectorImpl &HostID) { StringRef UUIDRef(UUIDStr); HostID.append(UUIDRef.begin(), UUIDRef.end()); -#elif LLVM_ON_UNIX +#elif !defined(__wasi__) whitequark wrote: Thanks, this is the cause of buildbot

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -508,6 +512,9 @@ static bool is_local_impl(struct STATVFS &Vfs) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) whitequark wrote: Does emscripten no longer have asm.

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread via cfe-commits
@@ -252,13 +257,21 @@ std::error_code Process::FixupStandardFileDescriptors() { if (NullFD == StandardFD) FDC.keepOpen(); +#if defined(__wasi__) +else // WASI does not have `dup2` by design. Return EBADF. whitequark wrote: No, no `/dev/null`. h

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -252,13 +257,21 @@ std::error_code Process::FixupStandardFileDescriptors() { if (NullFD == StandardFD) FDC.keepOpen(); +#if defined(__wasi__) +else // WASI does not have `dup2` by design. Return EBADF. jyknight wrote: Does wasi have /dev/null

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -71,6 +71,7 @@ ProcessInfo::ProcessInfo() : Pid(0), ReturnCode(0) {} ErrorOr sys::findProgramByName(StringRef Name, ArrayRef Paths) { assert(!Name.empty() && "Must have a name!"); +#if !defined(__wasi__) jyknight

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -19,13 +19,13 @@ namespace llvm { namespace sys { Watchdog::Watchdog(unsigned int seconds) { -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H && !defined(__wasi__) jyknight wrote: Looks like this could again be switched to a WASI/Watchdog.inc, with stub impls. htt

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -30,7 +30,10 @@ #include #include #include + +#if !defined(__wasi__) #include jyknight wrote: Is this header even needed on other platforms? I don't see anything clearly 'wait' related in this header. https://github.com/llvm/llvm-project/pull/92677 _

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -13,8 +13,17 @@ #include "llvm/Support/Signals.h" #include "llvm/Support/thread.h" #include +#if !defined(__wasi__) +#include +#endif +#if LLVM_ENABLE_THREADS jyknight wrote: This is unfortunate; there's no reason (in theory) that mutex shouldn't work fi

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
https://github.com/jyknight commented: Overall, I think this would be improved by splitting off a bunch of the lib/Support/Unix/*.inc files into separate lib/Support/WASI/*.inc files. Some of these files do seem to make sense to share, e.g. Path.inc, but seems to me like most of the rest are a

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -508,6 +512,9 @@ static bool is_local_impl(struct STATVFS &Vfs) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) jyknight wrote: `__EMSCRIPTEN__ || __wasi__` is effec

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -41,6 +41,8 @@ using namespace llvm; +#if defined(_WIN32) || !defined(__wasi__) jyknight wrote: This conditional is weird; there's no case where `__wasi__` is defined at the same time as `_WIN32`, so you just mean `#if !defined(__wasi__)`. Also you've r

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -94,7 +94,7 @@ static std::error_code getHostID(SmallVectorImpl &HostID) { StringRef UUIDRef(UUIDStr); HostID.append(UUIDRef.begin(), UUIDRef.end()); -#elif LLVM_ON_UNIX +#elif !defined(__wasi__) jyknight wrote: You're changing behavior for `!LLVM_ON_

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
https://github.com/jyknight edited https://github.com/llvm/llvm-project/pull/92677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -45,8 +45,11 @@ void lld::unlinkAsync(StringRef path) { if (!sys::fs::exists(path) || !sys::fs::is_regular_file(path)) return; +// If threads are disabled, remove the file synchronously. jyknight wrote: There's already a check below, ``` if (parall

[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)

2024-07-14 Thread James Y Knight via cfe-commits
@@ -273,9 +273,19 @@ static bool printMarkupStackTrace(StringRef Argv0, void **StackTrace, int Depth, } // Include the platform-specific parts of this class. -#ifdef LLVM_ON_UNIX +#if defined(__wasi__) +// WASI does not have signals. jyknight wrote: Move the

[clang] [llvm] AMDGPU: Move attributor into optimization pipeline (PR #83131)

2024-07-14 Thread Petr Hosek via cfe-commits
petrhosek wrote: I think we should go ahead and revert this change given that it's been almost an entire day and the builders are still broken. https://github.com/llvm/llvm-project/pull/83131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2024-07-14 Thread Julian Schmidt via cfe-commits
Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heidekrüger?= , Paul =?utf-8?q?Heide

[clang] Resign function pointer (PR #98847)

2024-07-14 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 0fc4e3052454391b7e54a05c1918527cf36c74cc b8e2bacfd917b190c62cdd296d51e8ba98cc4611 --e

[clang] [compiler-rt] [XRay] Add support for instrumentation of DSOs on x86_64 (PR #90959)

2024-07-14 Thread Brian Cain via cfe-commits
https://github.com/androm3da approved this pull request. You might want to get approval from someone else - I'm not even remotely close to a maintainer here. https://github.com/llvm/llvm-project/pull/90959 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang] inherit GD to let the codegen add kcfi type for ifunc (PR #96400)

2024-07-14 Thread via cfe-commits
https://github.com/aokblast closed https://github.com/llvm/llvm-project/pull/96400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] inherit GD to let the codegen add kcfi type for ifunc (PR #96400)

2024-07-14 Thread via cfe-commits
aokblast wrote: Wow, it helps me alot. I make the thing too complicate. I think I can close this PR. Thanks you two very much! https://github.com/llvm/llvm-project/pull/96400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-07-14 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,170 @@ +// RUN: %clang -Wno-constant-conversion -Wno-array-bounds -Wno-division-by-zero -Wno-shift-negative-value -Wno-shift-count-negative -Wno-int-to-pointer-cast -O0 -fsanitize=alignment,array-bounds,bool,float-cast-overflow,implicit-integer-sign-change,implicit-s

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/98276 >From 4b92c4af87a1a381dad09b243db4d3ec71d64738 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 18 Sep 2019 02:21:37 -0400 Subject: [PATCH 1/4] Sign function pointers passed to atexit and __cxa_atexit. Patch

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s + +class Foo { + public: + ~Foo() { + } +}; + +// CHECK-LABEL: define void @_Z1fv() +// CHECK: call void @__cxa_throw(ptr %{{.*}}, ptr @_ZTI3Foo, ptr

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-14 Thread Oliver Hunt via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

2024-07-14 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @shafik Thank you for your review. If the changes look good to @zyn0217, I would appreciate it if someone could merge them, as I don't have access. Thanks. https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

2024-07-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-14 Thread via cfe-commits
memory-thrasher wrote: Alright. Pinging the other reviewers. @rnk @tahonermann @MaxEW707 @zmodem https://github.com/llvm/llvm-project/pull/97792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [Fuchsia][CMake] Use MinSizeRel for baremetal runtimes (PR #98835)

2024-07-14 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek closed https://github.com/llvm/llvm-project/pull/98835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6ffa995 - [Fuchsia][CMake] Use MinSizeRel for baremetal runtimes (#98835)

2024-07-14 Thread via cfe-commits
Author: Petr Hosek Date: 2024-07-14T13:50:34-07:00 New Revision: 6ffa995517a9b4c15aba0eb511cba309e21808cf URL: https://github.com/llvm/llvm-project/commit/6ffa995517a9b4c15aba0eb511cba309e21808cf DIFF: https://github.com/llvm/llvm-project/commit/6ffa995517a9b4c15aba0eb511cba309e21808cf.diff LO

[clang] Adds a pseudonym to clang"s windows mangler... (PR #97792)

2024-07-14 Thread via cfe-commits
https://github.com/memory-thrasher updated https://github.com/llvm/llvm-project/pull/97792 >From d7223618f85cb14009c1b224b3b705cc78c54974 Mon Sep 17 00:00:00 2001 From: Sidney Kelley Date: Thu, 4 Jul 2024 23:03:16 -0700 Subject: [PATCH] Adds support to clang"s windows mangler to handle template

[clang] [Fuchsia][CMake] Use MinSizeRel for baremetal runtimes (PR #98835)

2024-07-14 Thread via cfe-commits
https://github.com/zeroomega approved this pull request. https://github.com/llvm/llvm-project/pull/98835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Fix a warning (PR #98611)

2024-07-14 Thread Piotr Fusik via cfe-commits
https://github.com/pfusik closed https://github.com/llvm/llvm-project/pull/98611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ca4ebae - [clang][NFC] Fix a warning (#98611)

2024-07-14 Thread via cfe-commits
Author: Piotr Fusik Date: 2024-07-14T22:44:19+02:00 New Revision: ca4ebae38c09b48c78789b77e7a98ec149957716 URL: https://github.com/llvm/llvm-project/commit/ca4ebae38c09b48c78789b77e7a98ec149957716 DIFF: https://github.com/llvm/llvm-project/commit/ca4ebae38c09b48c78789b77e7a98ec149957716.diff L

[clang] [llvm] AMDGPU: Move attributor into optimization pipeline (PR #83131)

2024-07-14 Thread via cfe-commits
dyung wrote: @arsenm are you aware that there is a test failure from this change that is still failing now about 16 hours later? Can you please take a look and revert if you need time to investigate so that we can get the bots back to green? Some failing bots: 1. https://lab.llvm.org/buildbot/

[clang] [llvm] [RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. (PR #95024)

2024-07-14 Thread Craig Topper via cfe-commits
https://github.com/topperc closed https://github.com/llvm/llvm-project/pull/95024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 73acf8d - [RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. (#95024)

2024-07-14 Thread via cfe-commits
Author: Craig Topper Date: 2024-07-14T13:39:17-07:00 New Revision: 73acf8d755e04996f17b7694b4794459e492dede URL: https://github.com/llvm/llvm-project/commit/73acf8d755e04996f17b7694b4794459e492dede DIFF: https://github.com/llvm/llvm-project/commit/73acf8d755e04996f17b7694b4794459e492dede.diff

[clang] [Clang] Make the GPU toolchains implicitly link `-lm` and `-lc` (PR #98170)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM, if @yxsamliu who has reviewed this is happy. https://github.com/llvm/llvm-project/pull/98170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

  1   2   >