[clang] 9247013 - [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (#77768)

2024-01-19 Thread via cfe-commits
Author: Mital Ashok Date: 2024-01-19T21:10:51+01:00 New Revision: 924701311aa79180e86ad8ce43d253f27d25ec7d URL: https://github.com/llvm/llvm-project/commit/924701311aa79180e86ad8ce43d253f27d25ec7d DIFF: https://github.com/llvm/llvm-project/commit/924701311aa79180e86ad8ce43d253f27d25ec7d.diff L

[clang] [libcxx] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-19 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-01-19 Thread Björn Schäpers via cfe-commits
@@ -3132,20 +3133,24 @@ static void sortCppIncludes(const FormatStyle &Style, } result += Includes[Index].Text; if (Cursor && CursorIndex == Index) - *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset; + NewCursor = IncludesBeginOffset + res

[clang] 8959206 - Remove an unused API; NFC

2024-01-19 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-01-19T15:15:24-05:00 New Revision: 89592061a4d53a5b78ca033fb13ba9f9f27ab1b7 URL: https://github.com/llvm/llvm-project/commit/89592061a4d53a5b78ca033fb13ba9f9f27ab1b7 DIFF: https://github.com/llvm/llvm-project/commit/89592061a4d53a5b78ca033fb13ba9f9f27ab1b7.diff

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-19 Thread via cfe-commits
tomasz-kaminski-sonarsource wrote: > I had an offline discussion with @Endilll during my morning office hours > today, and our current plan is: > > 1. Remove `Implicit` from the enumeration, rename `Call` and `List` to > `ParenList` and `BraceList`, respectively > 2. Add a new bit to the bit-f

[clang] [llvm] [AMDGPU]: Add and codegen sched_group_barrier_inst (PR #78775)

2024-01-19 Thread Jeffrey Byrnes via cfe-commits
https://github.com/jrbyrnes created https://github.com/llvm/llvm-project/pull/78775 As stated, this simply adds and codegens the builtin/intrinsic. A subsequent patch will interface it with IGroupLP. The idea is to give the users more expression by allowing them to create schedgroups which ha

[clang] [llvm] [AMDGPU]: Add and codegen sched_group_barrier_inst (PR #78775)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Jeffrey Byrnes (jrbyrnes) Changes As stated, this simply adds and codegens the builtin/intrinsic. A subsequent patch will interface it with IGroupLP. The idea is to give the users more expression by allowing them to create sched

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Bhuminjay Soni via cfe-commits
11happy wrote: @5chmidti I have added all the requested changes. Thank you https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-19 Thread via cfe-commits
@@ -3392,6 +3392,24 @@ the configuration (without a prefix: ``Auto``). Priority:1 SortPriority:0 +.. _MainIncludeChar: j-jorge wrote: Yes, is it supposed to be automatically generated? https://github.com/llvm/llvm-project/pull/787

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-19 Thread via cfe-commits
@@ -0,0 +1,27 @@ +// Test the combination of regrouped include directives, via regexes and j-jorge wrote: Ok I will move them there, thanks :) Should I remove these lit tests or are they complementary? https://github.com/llvm/llvm-project/pull/78752 ___

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -156,9 +156,8 @@ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32L %s // RV32L: error: invalid arch name 'rv32l' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32imadf -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32IMADF %s -// RV32I

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Louis Dionne via cfe-commits
https://github.com/ldionne commented: This is nice! Tagging a few people who might have opinions on the naming: @nico @kubamracek @AaronBallman Also, @jwakely it would be nice if this worked with libstdc++ as well in the future -- it would probably turn on checks like `__GLIBCXX_ASSERT__`. Do

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/78763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Louis Dionne via cfe-commits
@@ -281,6 +281,7 @@ LANGOPT(OffloadingNewDriver, 1, 0, "use the new driver for generating offloading LANGOPT(SYCLIsDevice , 1, 0, "Generate code for SYCL device") LANGOPT(SYCLIsHost, 1, 0, "SYCL host compilation") ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, S

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Louis Dionne via cfe-commits
@@ -275,6 +275,8 @@ def warn_drv_unknown_argument_clang_cl_with_suggestion : Warning< InGroup; def err_drv_unknown_target_triple : Error<"unknown target triple '%0'">; +def err_drv_stdlib_hardening_unavailable : Error<"libc++ hardening is available only when libc++ is used

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Louis Dionne via cfe-commits
@@ -851,6 +851,33 @@ static void InitializePredefinedMacros(const TargetInfo &TI, Twine(getClangFullCPPVersion()) + "\""); // Initialize language-specific preprocessor defines. + if (LangOpts.getLibcxxHardeningMode()) { +const char *LibcxxHardenin

[llvm] [clang] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -785,153 +878,61 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, Minor = Version->Minor; } -ISAInfo->addExtension(StringRef(&Baseline, 1), {Major, Minor}); +// Postpone AddExtension until end of this function +SeenEx

[llvm] [clang] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

2024-01-19 Thread Jonas Paulsson via cfe-commits
https://github.com/JonPsson1 updated https://github.com/llvm/llvm-project/pull/73511 >From 5c1c5d401775089bc600b85227f5e7bd974d4bd0 Mon Sep 17 00:00:00 2001 From: Jonas Paulsson Date: Thu, 23 Nov 2023 17:22:32 +0100 Subject: [PATCH 1/2] Initial Also handle weak symbols Fix test for -emit-llvm

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. GCC patch has just landed: https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643411.html https://github.com/llvm/llvm-project/pull/78120 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/74629 >From 5bae541608ffacfee767da592afe65003ccdad79 Mon Sep 17 00:00:00 2001 From: Ben Dunbobbin Date: Wed, 6 Dec 2023 15:47:52 + Subject: [PATCH 1/3] Add a "don't override" mapping for -fvisibility-from-dllst

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Address the > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 > > This patch relax the -march string for accept any order. Perhaps: Follow https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 by dropping the order requirement of `-march`.

[compiler-rt] [llvm] [flang] [clang-tools-extra] [clang] [lld] [libc] [libcxx] [lldb] Make clang report invalid target versions for all environment types. (PR #78655)

2024-01-19 Thread via cfe-commits
https://github.com/ZijunZhaoCCK updated https://github.com/llvm/llvm-project/pull/78655 >From f440f44e7e270d4636ad39f4e4223c904e496d3a Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 19 Jan 2024 00:47:05 + Subject: [PATCH] Make clang report invalid target versions for all environment.

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -337,10 +319,79 @@ TEST(ParseArchString, AcceptsUnderscoreSplittingExtensions) { } } +TEST(ParseArchString, AcceptsRelaxSingleLetterExtensions) { + for (StringRef Input : + {"rv32imfad", "rv32im_fa_d", "rv32im2p0fad", "rv32i2p1m2p0fad"}) { +auto MaybeISAInfo =

[llvm] [clang] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

2024-01-19 Thread Jonas Paulsson via cfe-commits
@@ -11,6 +11,7 @@ //===--===// #include "SystemZ.h" +#include "clang/AST/Decl.h" JonPsson1 wrote: Ok, that makes more sense to me know considering different ways of building clang, thanks.

[libcxx] [llvm] [compiler-rt] [clang] [libc] [lld] [lldb] [clang-tools-extra] [flang] Make clang report invalid target versions for all environment types. (PR #78655)

2024-01-19 Thread via cfe-commits
https://github.com/ZijunZhaoCCK updated https://github.com/llvm/llvm-project/pull/78655 >From f440f44e7e270d4636ad39f4e4223c904e496d3a Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 19 Jan 2024 00:47:05 + Subject: [PATCH] Make clang report invalid target versions for all environment.

[clang] [openmp] [OpenMP][USM] Introduces -fopenmp-force-usm flag (PR #76571)

2024-01-19 Thread Jan Patrick Lehr via cfe-commits
https://github.com/jplehr updated https://github.com/llvm/llvm-project/pull/76571 >From 41b227e2c84b3c7eeedb6a9ebf559bec2c34aec3 Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Fri, 29 Dec 2023 04:32:24 -0500 Subject: [PATCH] [OpenMP][USM] Introduces -fopenmp-force-usm flag This flag forces the c

[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

2024-01-19 Thread Amirreza Ashouri via cfe-commits
@@ -2669,6 +2669,8 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const { return false; } else if (const auto *RD = BaseElementType->getAsRecordDecl()) { return RD->canPassInRegisters(); + } else if (BaseElementType.isTriviallyCopyableType(C

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread Paul T Robinson via cfe-commits
@@ -79,6 +107,8 @@ extern void __declspec(dllimport) imported_e(); // EXPLICIT-DAG: declare hidden void @_Z10imported_ev() // ALL_DEFAULT-DAG: declare void @_Z1ev() // ALL_DEFAULT-DAG: declare void @_Z10imported_ev() +// ALL_KEEP-DAG: declare hidden void @_Z1ev() +// ALL_KEEP-D

[clang] [flang] [flang]Add support for -moutline-atomics and -mno-outline-atomics (PR #78755)

2024-01-19 Thread Kiran Chandramohan via cfe-commits
@@ -0,0 +1,11 @@ +! Test that flang-new forwards the -moutline-atomics and -mno-outline-atomics. +! RUN: %flang -moutline-atomics --target=aarch64-none-none -### %s -o %t 2>&1 | FileCheck %s +! CHECK: "-target-feature" "+outline-atomics" + +! RUN: %flang -mno-outline-atomics --t

[clang] [flang] [flang]Add support for -moutline-atomics and -mno-outline-atomics (PR #78755)

2024-01-19 Thread Kiran Chandramohan via cfe-commits
@@ -354,6 +354,27 @@ void Flang::addTargetOptions(const ArgList &Args, CmdArgs.push_back(Args.MakeArgString(CPU)); } + if (Arg *A = Args.getLastArg(options::OPT_moutline_atomics, + options::OPT_mno_outline_atomics)) { +// Option -moutli

[compiler-rt] [llvm] [flang] [clang-tools-extra] [clang] [lld] [libc] [libcxx] [lldb] Make clang report invalid target versions for all environment types. (PR #78655)

2024-01-19 Thread via cfe-commits
https://github.com/ZijunZhaoCCK updated https://github.com/llvm/llvm-project/pull/78655 >From f440f44e7e270d4636ad39f4e4223c904e496d3a Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 19 Jan 2024 00:47:05 + Subject: [PATCH 1/2] Make clang report invalid target versions for all environme

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/74629 >From 5bae541608ffacfee767da592afe65003ccdad79 Mon Sep 17 00:00:00 2001 From: Ben Dunbobbin Date: Wed, 6 Dec 2023 15:47:52 + Subject: [PATCH 1/4] Add a "don't override" mapping for -fvisibility-from-dllst

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread via cfe-commits
@@ -79,6 +107,8 @@ extern void __declspec(dllimport) imported_e(); // EXPLICIT-DAG: declare hidden void @_Z10imported_ev() // ALL_DEFAULT-DAG: declare void @_Z1ev() // ALL_DEFAULT-DAG: declare void @_Z10imported_ev() +// ALL_KEEP-DAG: declare hidden void @_Z1ev() +// ALL_KEEP-D

[compiler-rt] [clang] [llvm] [AArch64][FMV] Support feature MOPS in Function Multi Versioning. (PR #78788)

2024-01-19 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/78788 The patch adds support for FEAT_MOPS (Memory Copy and Memory Set instructions) in Function Multi Versioning. The bits [19:16] of the system register ID_AA64ISAR2_EL1 indicate whether FEAT_MOPS is implemented in

[compiler-rt] [clang] [llvm] [AArch64][FMV] Support feature MOPS in Function Multi Versioning. (PR #78788)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alexandros Lamprineas (labrinea) Changes The patch adds support for FEAT_MOPS (Memory Copy and Memory Set instructions) in Function Multi Versioning. The bits [19:16] of the system register ID_AA64ISAR2_EL1 indicate whether FEAT_MOPS is i

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/74629 >From 5bae541608ffacfee767da592afe65003ccdad79 Mon Sep 17 00:00:00 2001 From: Ben Dunbobbin Date: Wed, 6 Dec 2023 15:47:52 + Subject: [PATCH 1/5] Add a "don't override" mapping for -fvisibility-from-dllst

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 approved this pull request. Re-approving. https://github.com/llvm/llvm-project/pull/74629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9175dd9 - [CMake] Detect properly new linker introduced in Xcode 15 (#77806)

2024-01-19 Thread via cfe-commits
Author: Eric Miotto Date: 2024-01-19T16:32:32-05:00 New Revision: 9175dd9cbcad01a47acea9f1b99a0c96bf1a9a29 URL: https://github.com/llvm/llvm-project/commit/9175dd9cbcad01a47acea9f1b99a0c96bf1a9a29 DIFF: https://github.com/llvm/llvm-project/commit/9175dd9cbcad01a47acea9f1b99a0c96bf1a9a29.diff L

[clang] [llvm] [CMake] Detect properly new linker introduced in Xcode 15 (PR #77806)

2024-01-19 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/77806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > For unions, clang will use the type of the union member with the largest size > as the alloca type, regardless of which union member is active. I haven't > tried, but your patch will probably compute the subobject size based on that > arbitrarily picked member, rather than th

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > @bwendling I think you are reading the GCC docs too pedantically. In > particular, they also say > > If there are multiple objects ptr can point to and all of them are known at > > compile time, the returned number is the maximum of remaining byte counts > > in those object

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > For unions, clang will use the type of the union member with the largest > > size as the alloca type, regardless of which union member is active. I > > haven't tried, but your patch will probably compute the subobject size > > based on that arbitrarily picked member, rathe

[clang] Add a "don't override" mapping for -fvisibility-from-dllstorageclass (PR #74629)

2024-01-19 Thread via cfe-commits
https://github.com/bd1976bris closed https://github.com/llvm/llvm-project/pull/74629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cd05ade - Add a "don't override" mapping for -fvisibility-from-dllstorageclass (#74629)

2024-01-19 Thread via cfe-commits
Author: bd1976bris Date: 2024-01-19T21:57:40Z New Revision: cd05ade13a66d4fb2daff489b2c02ac1ae2070d1 URL: https://github.com/llvm/llvm-project/commit/cd05ade13a66d4fb2daff489b2c02ac1ae2070d1 DIFF: https://github.com/llvm/llvm-project/commit/cd05ade13a66d4fb2daff489b2c02ac1ae2070d1.diff LOG: Ad

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > > But mode 0 and 1 are in general asking for an upper bound on the accessible > > bytes (that is, an N so any.access beyond N bytes is definitely out of > > bounds), so it seems to me that returning -1 is strictly worse than > > returning 48. > > It's the second bit that con

[clang] [clang-tools-extra] [clang] Remove `CXXNewInitializationStyle::Implicit` (PR #78793)

2024-01-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/78793 This is a follow up to https://github.com/llvm/llvm-project/pull/71417 , which aims to resolve concerns brought up there. Namely, this patch replaces `CXXNewInitializationStyle::Implicit` with a dedicated `HasIn

[clang] [clang-tools-extra] [clang] Remove `CXXNewInitializationStyle::Implicit` (PR #78793)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-modules Author: Vlad Serebrennikov (Endilll) Changes This is a follow up to https://github.com/llvm/llvm-project/pull/71417 , which aims to resolve concerns brought up there. Namely, this patch replaces `CXXNewInit

[clang] [clang-tools-extra] [clang] Remove `CXXNewInitializationStyle::Implicit` (PR #78793)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This is a follow up to https://github.com/llvm/llvm-project/pull/71417 , which aims to resolve concerns brought up there. Namely, this patch replaces `CXXNewInitializationStyle::Implicit` with a dedica

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/75364 >From 97efed8c73aed4fdca5510013c844e84953ec256 Mon Sep 17 00:00:00 2001 From: Ben Dunbobbin Date: Tue, 12 Dec 2023 08:07:17 + Subject: [PATCH 1/6] [Sema] Provide `-fno-/-fvisibility-global-new-delete` opt

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread via cfe-commits
@@ -359,6 +359,12 @@ void toolchains::PS4PS5Base::addClangTargetOptions( CC1Args.push_back("-fno-use-init-array"); + // Default to -fglobal-new-delete-visibility=source for PS5. bd1976bris wrote: Thanks - now using the correct spelling. https://github.co

[clang] [llvm] [compiler-rt] [AArch64][FMV] Support feature MOPS in Function Multi Versioning. (PR #78788)

2024-01-19 Thread Pavel Iliin via cfe-commits
@@ -172,6 +172,11 @@ static void __init_cpu_features_constructor(unsigned long hwcap, // ID_AA64ISAR1_EL1.LS64 >= 0b0011 if (extractBits(ftr, 60, 4) >= 0x3) setCPUFeature(FEAT_LS64_ACCDATA); + ilinpv wrote: There is HWCAP2_MOPS support in ELF hw

[clang-tools-extra] [clang-tidy] Fix crash in modernize-loop-convert when int is used as iterator (PR #78796)

2024-01-19 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/78796 Fix crash when built-in type (like int) is used as iterator, or when call to begin() return integer. Closes #78381 >From 812b49d8e5e6c07a9d26b36413b26e6f0dbe277f Mon Sep 17 00:00:00 2001 From: Piotr Zegar Dat

[clang-tools-extra] [clang-tidy] Fix crash in modernize-loop-convert when int is used as iterator (PR #78796)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Piotr Zegar (PiotrZSL) Changes Fix crash when built-in type (like int) is used as iterator, or when call to begin() return integer. Closes #78381 --- Full diff: https://github.com/llvm/llvm-project/pull/78796.diff 3 Files Affected

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,52 @@ +/// Check driver handling for "-fvisibility-global-new-delete-hidden" and "-fvisibility-global-new-delete=". + +/// These options are not added by default. +// RUN: %clang -### -target x86_64-unknown-unknown -x cl -c -emit-llvm %s 2>&1 | \ Mask

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

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

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: Taking a step back, while this patch is not the right direction, we can and should do better for the original example. Probably the best way to do that is to analyze the operand to `__builtin_[dynamic_]object_size` in the frontend and compute a better bound based on the form of

[clang] [clang-tools-extra] [clang] Remove `CXXNewInitializationStyle::Implicit` (PR #78793)

2024-01-19 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/78793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > > But mode 0 and 1 are in general asking for an upper bound on the > > > accessible bytes (that is, an N so any.access beyond N bytes is > > > definitely out of bounds), so it seems to me that returning -1 is > > > strictly worse than returning 48. > > > > > > It's the s

[clang] [llvm] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

2024-01-19 Thread NAKAMURA Takumi via cfe-commits
@@ -11,6 +11,7 @@ //===--===// #include "SystemZ.h" +#include "clang/AST/Decl.h" chapuni wrote: Thanks. Now you can remove this. This is the only point from my side. > (note that clang itse

[clang] [llvm] [clang, SystemZ] Pass HasDef flag to getMinGlobalAlign(). (PR #73511)

2024-01-19 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/73511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=hidden -emit-llvm -o - | FileCheck %s -DLINKAGE=dso_local +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=default -fvisibility-global-new-delete=force-hid

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -3864,9 +3864,16 @@ def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group HelpText<"Give global types 'default' visibility and global functions and " "variables 'hidden' visibility by default">; def fvisibility_global_new_delete_hidden : Flag<

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > Taking a step back, while this patch is not the right direction, we can and > should do better for the original example. Probably the best way to do that > is to analyze the operand to `__builtin_[dynamic_]object_size` in the > frontend and compute a better bound based on th

[clang] [compiler-rt] [llvm] [AArch64][FMV] Support feature MOPS in Function Multi Versioning. (PR #78788)

2024-01-19 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/78788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Consider adding a note to clang/docs/ReleaseNotes.rst. With a few nits this LGTM. https://github.com/llvm/llvm-project/pull/75364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=hidden -emit-llvm -o - | FileCheck %s -DLINKAGE=dso_local +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=default -fvisibility-global-new-delete=force-hid

[clang] [openmp] [OpenMP][USM] Introduces -fopenmp-force-usm flag (PR #76571)

2024-01-19 Thread Jan Patrick Lehr via cfe-commits
jplehr wrote: I just realized that I need to update the clang lit tests, so this is *not ready to land*, but I don't see a button to indicate that. https://github.com/llvm/llvm-project/pull/76571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] C++ Templates: Refactor and fix `TransformLambdaExpr`'s mishandling of TypeLocs (PR #78801)

2024-01-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/78801 `TreeTransform::TransformLambdaExpr` has an outlier case in `TransformLambdaExpr`. The `TransformFunctionProtoType` call cannot use the `getDerived()` version because of some reasons I still don't fully u

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > Perhaps we need clarification on what GCC means by "may point to multiple > objects" in this instance. To me that means either "get me the size of the > largest of these multiple objects" or "size of the smallest." In my eyes, > that means pointing to a union field. Per @nik

[clang] [Clang] C++ Templates: Refactor and fix `TransformLambdaExpr`'s mishandling of TypeLocs (PR #78801)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yuxuan Chen (yuxuanchen1997) Changes `TreeTransform::TransformLambdaExpr` has an outlier case in `TransformLambdaExpr`. The `TransformFunctionProtoType` call cannot use the `getDerived()` version because of some reasons I still don't full

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Jonathan Wakely via cfe-commits
jwakely wrote: > Also, @jwakely it would be nice if this worked with libstdc++ as well in the > future -- it would probably turn on checks like `__GLIBCXX_ASSERT__`. That should be `_GLIBCXX_ASSERTIONS` No other thoughts for now. GCC has `-fhardened` now, which already defines that macro. Th

[clang] [Clang] Drop workaround for old gcc versions (PR #78803)

2024-01-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/78803 This workaround existed due to https://gcc.gnu.org/PR56135. The website says that the bug was fixed in GCC 4.8.0 and the latest host toolchain requirement says GCC 7.4. I think it would be very safe to dr

[clang] [Clang] Drop workaround for old gcc versions (PR #78803)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yuxuan Chen (yuxuanchen1997) Changes This workaround existed due to https://gcc.gnu.org/PR56135. The website says that the bug was fixed in GCC 4.8.0 and the latest host toolchain requirement says GCC 7.4. I think it would be very safe to

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > Perhaps we need clarification on what GCC means by "may point to multiple > > objects" in this instance. To me that means either "get me the size of the > > largest of these multiple objects" or "size of the smallest." In my eyes, > > that means pointing to a union field.

[clang] [clang][AST] Fix printing `TagDecl`s. (PR #69971)

2024-01-19 Thread via cfe-commits
isuckatcs wrote: Ping https://github.com/llvm/llvm-project/pull/69971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Cleaning up `FIXME`s added during `ArrayInitLoopExpr` implementation. (PR #70053)

2024-01-19 Thread via cfe-commits
isuckatcs wrote: Ping https://github.com/llvm/llvm-project/pull/70053 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add option -fstdlib-hardening= (PR #78763)

2024-01-19 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/78763 >From 0d68286bd8b7206c5045062f65ccaf1c3fb54714 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 18 Jan 2024 16:20:41 -0800 Subject: [PATCH 1/2] Add option -fstdlib-hardening= The option allows users to

[clang] Add option -fstdlib-hardening= (PR #78763)

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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti requested changes to this pull request. Sorry for making this so iterative ^^ but I think that after these everything is good from my side. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,32 @@ +.. title:: clang-tidy - readability-use-std-min-max + +readability-use-std-min-max +=== + +Replaces certain conditionals with ``std::min`` or ``std::max`` for readability, +promoting use of standard library functions. Note: This may impac

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-19 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/77393 >From 93ab63157297553fa678752995773db8b14642fe Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 8 Jan 2024 15:22:21 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-

[clang] [llvm] [clang-tools-extra] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -4557,7 +4561,13 @@ struct MemorySanitizerVisitor : public InstVisitor { return; Value *SizeVal = IRB.CreateTypeSize(MS.IntptrTy, DL.getTypeStoreSize(ElemTy)); -IRB.CreateCall(MS.MsanInstrumentAsmStoreFn, {Operand, SizeVal}); +if (MS.CompileKernel) {

[clang-tools-extra] [clang-tidy] Fix crash in modernize-loop-convert when int is used as iterator (PR #78796)

2024-01-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 approved this pull request. https://github.com/llvm/llvm-project/pull/78796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/77393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix crash in modernize-loop-convert when int is used as iterator (PR #78796)

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

[clang] [clang-repl] Add a interpreter-specific overload of operator new for C++ (PR #76218)

2024-01-19 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: I suspect asan may complain on new/free mismatch https://github.com/llvm/llvm-project/pull/76218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Try patch from #76218 (PR #78813)

2024-01-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/78813 None >From b2c13350471c50f75d7a32d118faf7b04a5fbede Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 19 Jan 2024 16:07:34 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?

[clang] Try patch from #76218 (PR #78813)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/78813.diff 1 Files Affected: - (modified) clang/unittests/Interpreter/InterpreterTest.cpp (+3-8) ``diff diff --git a/clang/unittests/I

[clang] Ensure bitmap for ternary condition is updated before visiting children (PR #78814)

2024-01-19 Thread Alan Phipps via cfe-commits
https://github.com/evodius96 created https://github.com/llvm/llvm-project/pull/78814 This is a fix for MC/DC issue https://github.com/llvm/llvm-project/issues/78453 in which a ConditionalOperator that evaluates a complex condition was incorrectly updating its global bitmap after visiting its L

[clang] Ensure bitmap for ternary condition is updated before visiting children (PR #78814)

2024-01-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Alan Phipps (evodius96) Changes This is a fix for MC/DC issue https://github.com/llvm/llvm-project/issues/78453 in which a ConditionalOperator that evaluates a complex condition was incorrectly updating its global bitmap after vis

[clang] Try patch from #76218 (PR #78813)

2024-01-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/78813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Try on bot patch from #76218 (PR #78813)

2024-01-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/78813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Try on bot patch from #76218 (PR #78813)

2024-01-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka converted_to_draft https://github.com/llvm/llvm-project/pull/78813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Fix the crash introduced by the unsafe invocation of span::data warning (PR #78815)

2024-01-19 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak created https://github.com/llvm/llvm-project/pull/78815 The patch fixes the crash introduced by the DataInvocation warning gadget designed to warn against unsafe invocations of span::data method. Radar: 121223051 >From 6334cd361f79fc79f32b8ca95c6f31a083704332

<    1   2   3   4   5   6   >