[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

[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 =

[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

[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

[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

[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 , // 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 ==

[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

[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 , // 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 ==

[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

[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

[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

[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.

[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

[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:

[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

[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

[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

[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.

[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

[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

[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 ) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) jyknight wrote: It doesn't; C++ compilation only targets

[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?

[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 , 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 care

[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?

[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 ) { 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 ) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) whitequark wrote: Does emscripten no longer have asm.js

[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`.

[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

[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__)

[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.

[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

[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

[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 ) { #elif defined(__EMSCRIPTEN__) // Emscripten doesn't currently support remote filesystem mounts. return true; +#elif defined(__wasi__) jyknight wrote: `__EMSCRIPTEN__ || __wasi__` is

[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

[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 ) { 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_UNIX`

[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

[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

[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

[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

[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

[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

[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

[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

[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.

[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,

[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 , llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the

[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

[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

[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

[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

[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.

[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

[clang] [llvm] [X86][MC,Driver] Support -msse2avx to encode SSE instruction with VEX prefix (PR #96860)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. This driver option needs a `TargetSpecific` flag, otherwise this LGTM. https://github.com/llvm/llvm-project/pull/96860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) Changes Size matters more than performance for these targets. --- Full diff: https://github.com/llvm/llvm-project/pull/98835.diff 1 Files Affected: - (modified) clang/cmake/caches/Fuchsia-stage2.cmake (+4-4)

[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

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/95934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-14 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/98835 Size matters more than performance for these targets. >From 7125521d0fd280a89f5a5576eec512bb99aa7dde Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Sun, 14 Jul 2024 13:27:08 -0700 Subject: [PATCH]

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

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. 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] [CodeGen] Set attributes on resolvers emitted after ifuncs (PR #98832)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/98832 >From 15011e64e79627a3de2e4434549fabbf7fe86e09 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 14 Jul 2024 12:11:17 -0700 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[clang] 48d703e - Revert "[clang][Interp] Implement dynamic memory allocation handling (#70306)"

2024-07-14 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-07-14T21:17:47+02:00 New Revision: 48d703e7f56282ce5d690e45a129a4a7fd040ee6 URL: https://github.com/llvm/llvm-project/commit/48d703e7f56282ce5d690e45a129a4a7fd040ee6 DIFF: https://github.com/llvm/llvm-project/commit/48d703e7f56282ce5d690e45a129a4a7fd040ee6.diff

[clang] ba3dcec - Revert "[clang][Interp] Fix a build failure on Windows"

2024-07-14 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-07-14T21:17:39+02:00 New Revision: ba3dcec16b6bb955f2c65a3df157744069441d7f URL: https://github.com/llvm/llvm-project/commit/ba3dcec16b6bb955f2c65a3df157744069441d7f DIFF: https://github.com/llvm/llvm-project/commit/ba3dcec16b6bb955f2c65a3df157744069441d7f.diff

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

2024-07-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: > The usual mechanism for emitting deferred definitions involves > CodeGenModule::EmitDeferred(): declarations get added to the list by > addDeferredDeclToEmit(), then it goes through to emit all the declarations on > the list. So it's a matter of making sure the resolver ends

[clang] [CodeGen] Set attributes on resolvers emitted after ifuncs (PR #98832)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Fangrui Song (MaskRay) Changes When an ifunc is emitted before its resolver, the resolver is created by `GetOrCreateLLVMFunction` without ever calling `SetFunctionAttributes`. The causes missing

[clang] [CodeGen] Set attributes on resolvers emitted after ifuncs (PR #98832)

2024-07-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/98832 When an ifunc is emitted before its resolver, the resolver is created by `GetOrCreateLLVMFunction` without ever calling `SetFunctionAttributes`. The causes missing `!kcfi_type` with -fsanitize=kcfi. ``` extern

[clang] [clang][Interp] Implement dynamic memory allocation handling (PR #70306)

2024-07-14 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-x64-windows-msvc` running on `windows-gcebot2` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/63/builds/509 Here is the relevant piece of the build

[clang] [lldb] Add Static Build option for LLDB Libraries (PR #98827)

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

[clang] [lldb] Add Static Build option for LLDB Libraries (PR #98827)

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

[clang] [lldb] Add Static Build option for LLDB Libraries (PR #98827)

2024-07-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Narayan (vortex73) Changes - [ ] Added Option to statically build lldb - [ ] Packages lldb for easier package finding in other builds. --- Full diff: https://github.com/llvm/llvm-project/pull/98827.diff 4 Files Affected: - (modified)

[clang] [lldb] Add Static Build option for LLDB Libraries (PR #98827)

2024-07-14 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you,

[clang] [lldb] Add Static Build option for LLDB Libraries (PR #98827)

2024-07-14 Thread via cfe-commits
https://github.com/vortex73 created https://github.com/llvm/llvm-project/pull/98827 - [ ] Added Option to statically build lldb - [ ] Packages lldb for easier package finding in other builds. >From 8ecf1b30678503f96d41112feb3ac87944c13158 Mon Sep 17 00:00:00 2001 From: Vortex Date: Sun, 14

  1   2   >