[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93758 >From 5ecb3c36d40bb4a361b9af8776e9c4e45fa15b8d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 29 May 2024 22:23:01 -0300 Subject: [PATCH] [clang] CWG150: add tests and change to unreleased --- clang

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/80801 >From 2c8c5129a9df16c87d9a89ce3864b857c438978e Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Mon, 5 Feb 2024 21:26:07 -0800 Subject: [PATCH 1/4] [clang] require template arg list after template kw Require a t

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/80801 >From 2c8c5129a9df16c87d9a89ce3864b857c438978e Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Mon, 5 Feb 2024 21:26:07 -0800 Subject: [PATCH 1/5] [clang] require template arg list after template kw Require a t

[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: This looks good to me now. The contents of the test go over my head, though. https://github.com/llvm/llvm-project/pull/93758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] Fix build warning for '[X86] Support EGPR for inline assembly. (#92338)' (PR #93777)

2024-05-30 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf created https://github.com/llvm/llvm-project/pull/93777 None >From 7f5ca96930fe48617115e2403094e2724aa7b9cd Mon Sep 17 00:00:00 2001 From: Freddy Ye Date: Thu, 30 May 2024 15:20:18 +0800 Subject: [PATCH] Fix build warning for '[X86] Support EGPR for inline assemb

[clang] 6f2794a - Fix build warning for '[X86] Support EGPR for inline assembly. (#92338)' (#93777)

2024-05-30 Thread via cfe-commits
Author: Freddy Ye Date: 2024-05-30T15:25:08+08:00 New Revision: 6f2794afeb3c76293cc91cb9f8ae8c90a2ba8b3e URL: https://github.com/llvm/llvm-project/commit/6f2794afeb3c76293cc91cb9f8ae8c90a2ba8b3e DIFF: https://github.com/llvm/llvm-project/commit/6f2794afeb3c76293cc91cb9f8ae8c90a2ba8b3e.diff LOG

[clang] Fix build warning for '[X86] Support EGPR for inline assembly. (#92338)' (PR #93777)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Freddy Ye (FreddyLeaf) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/93777.diff 1 Files Affected: - (modified) clang/lib/Basic/Targets/X86.cpp (+1) ``diff diff --git a/clang/lib/Basic/Targets/X86.cpp b/cla

[clang] Fix build warning for '[X86] Support EGPR for inline assembly. (#92338)' (PR #93777)

2024-05-30 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf closed https://github.com/llvm/llvm-project/pull/93777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-30 Thread Nikita Popov via cfe-commits
nikic wrote: This change seems to have some compile-time overhead. I'm not seeing a lot on CTMark, but during the clang bootstrap there are many files with ~1% regressions (http://llvm-compile-time-tracker.com/compare_clang.php?from=ec8fe598a94d2826f8e4f79367a5a45a6b32d284&to=9c4a716c1292096fc

[clang] [X86]Add support for _outp{|w|d} (PR #93774)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -329,6 +329,26 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { __asm__ volatile("hlt"); } + +static __inline__ int __DEFAULT_FN_ATTRS _outp(unsigned short port, int data) { + __asm__ v

[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-30 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/93758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @nikic Thanks for the heads-up. I expected some impact. There are some ideas to regain that loss in follow up work. https://github.com/llvm/llvm-project/pull/93433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] 0eb4bf2 - [clang] CWG150: add tests and change to unreleased (#93758)

2024-05-30 Thread via cfe-commits
Author: Matheus Izvekov Date: 2024-05-30T04:39:21-03:00 New Revision: 0eb4bf2faf4125d4d279463390a753c8c36a6937 URL: https://github.com/llvm/llvm-project/commit/0eb4bf2faf4125d4d279463390a753c8c36a6937 DIFF: https://github.com/llvm/llvm-project/commit/0eb4bf2faf4125d4d279463390a753c8c36a6937.dif

[clang] [clang] CWG150: add tests and change to unreleased (PR #93758)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] text ast-dumper: dump TemplateName for TST and DTST (PR #93766)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-05-30 Thread John McCall via cfe-commits
@@ -5348,18 +5348,8 @@ Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) { return llvm::UndefValue::get(ArgTy); } - // FIXME Volatility. - llvm::Value *Val = Builder.CreateLoad(ArgPtr); - - // If EmitVAArg promoted the type, we must truncate it. - if (ArgTy !=

[clang] [clang] text ast-dumper: dump TemplateName for TST and DTST (PR #93766)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93766 >From 774fa391d3ba427adf81919c361dd4f01e72d6a1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 30 May 2024 01:24:53 -0300 Subject: [PATCH] [clang] text ast-dumper: dump TemplateName for TST and DTST I

[clang] [clang][Interp] Member Pointers (PR #91303)

2024-05-30 Thread via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,112 @@ +//===- MemberPointer.h --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exce

[clang] 3cabbf6 - [clang] text ast-dumper: dump TemplateName for TST and DTST (#93766)

2024-05-30 Thread via cfe-commits
Author: Matheus Izvekov Date: 2024-05-30T04:48:45-03:00 New Revision: 3cabbf60393cc8d55fe635e35e89e5973162de33 URL: https://github.com/llvm/llvm-project/commit/3cabbf60393cc8d55fe635e35e89e5973162de33 DIFF: https://github.com/llvm/llvm-project/commit/3cabbf60393cc8d55fe635e35e89e5973162de33.dif

[clang] [clang] text ast-dumper: dump TemplateName for TST and DTST (PR #93766)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-05-30 Thread via cfe-commits
@@ -1036,6 +1036,7 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, // be dependent, because there are template parameters in scope. CXXRecordDecl::LambdaDependencyKind LambdaDependencyKind = CXXRecordDecl::LDK_Unknown; + c

[clang] [X86]Add support for _outp{|w|d} (PR #93774)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93774 >From 38359132ea0b3b56900ba48827c86a93c017223a Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Wed, 29 May 2024 22:40:47 -0700 Subject: [PATCH 1/2] Add support for _outp{|w|d} --- clang/lib/Headers/intrin

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread Erick Velez via cfe-commits
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/80801 >From 2c8c5129a9df16c87d9a89ce3864b857c438978e Mon Sep 17 00:00:00 2001 From: Erick Velez Date: Mon, 5 Feb 2024 21:26:07 -0800 Subject: [PATCH 1/6] [clang] require template arg list after template kw Require a t

[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-05-30 Thread Owen Pan via cfe-commits
owenca wrote: Please refer to e3eca335940251308c8990c8880341002e74b9c1 for grouping/deprecating existing options with a new one. https://github.com/llvm/llvm-project/pull/91221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread Erick Velez via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-30 Thread via cfe-commits
cor3ntin wrote: Can you provide a better description for the PR (such as "[clang] fix a crash with block captures inside a lambda" ) and an entry in clang/docs/ReleaseNotes.rst referencing the fixed issue? Thanks! The change itself looks good except modulo @zyn0217's feedback https://github

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-30 Thread Qizhi Hu via cfe-commits
jcsxky wrote: @mizvekov After I apply you changes in this patch, https://github.com/llvm/llvm-project/issues/91677 is still crash(although it makes sense with `-ast-dump` option). I put it below for explanation clearly: ```cpp template struct t1 { template struct t2 {}; }; template t1::

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
https://github.com/alexander-shaposhnikov created https://github.com/llvm/llvm-project/pull/93783 Add plumbing for the numerical sanitizer on Clang's side. This patch was extracted from https://github.com/llvm/llvm-project/pull/85916 Test plan: ninja check-all >From 1b02427f1dce543ef5ada06def

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Could you please take another look? Sure, but let's take the discussion to the other PR. https://github.com/llvm/llvm-project/pull/93433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-llvm-ir Author: Alexander Shaposhnikov (alexander-shaposhnikov) Changes Add plumbing for the numerical sanitizer on Clang's side. This patch was extracted from https://github.com/llvm/llvm-project/pull/85916 Test plan: ninja

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Alexander Shaposhnikov (alexander-shaposhnikov) Changes Add plumbing for the numerical sanitizer on Clang's side. This patch was extracted from https://github.com/llvm/llvm-project/pull/85916 Test plan: ninja check-all --- Full d

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Matt Arsenault via cfe-commits
@@ -285,6 +285,9 @@ def SanitizeHWAddress : EnumAttr<"sanitize_hwaddress", [FnAttr]>; /// MemTagSanitizer is on. def SanitizeMemTag : EnumAttr<"sanitize_memtag", [FnAttr]>; +/// NumericalStabilitySanitizer is on. +def SanitizeNumericalStability : EnumAttr<"sanitize_numericals

[clang] cd9a02e - [CodeGen] Remove useless zero-index constant GEPs (NFCI)

2024-05-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-05-30T10:24:57+02:00 New Revision: cd9a02e2c76ec2f37409c6f7becd61e605c117d8 URL: https://github.com/llvm/llvm-project/commit/cd9a02e2c76ec2f37409c6f7becd61e605c117d8 DIFF: https://github.com/llvm/llvm-project/commit/cd9a02e2c76ec2f37409c6f7becd61e605c117d8.diff

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
https://github.com/alexander-shaposhnikov updated https://github.com/llvm/llvm-project/pull/93783 >From c02e1911abb04c4f9ec36d30984d3b10a87e1739 Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Thu, 30 May 2024 08:15:44 + Subject: [PATCH] [Clang][Sanitizers] Add numerical sanitiz

[clang] [X86]Add support for _outp{|w|d} (PR #93774)

2024-05-30 Thread Simon Pilgrim via cfe-commits
@@ -63,6 +63,91 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] +// +// CHECK-I386-LABEL: define dso_local noundef i32 @test_outp( +// CHECK-I386-SAME: i16 noundef zeroext [[PORT:

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
https://github.com/alexander-shaposhnikov converted_to_draft https://github.com/llvm/llvm-project/pull/93783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: So After we have formed a TemplateSpecializationType, we are done with the NNS. We keep it around in an ElaboratedType for type sugar only, it should not be needed to compile the program correctly anymore. So I think this solution violates one important a

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-30 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Hi, thanks for this contribution. Sadly, it messes up my local checkout on MacOS (which is insensitive when it comes to files names). These files are problematic: * "asm-constraint-jR.ll" and "asm-constraint-jr.ll" Please, could you rename them so that they are not identica

[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I think the issue is that we no longer passed `-fno-lifetime-dse` to GCC due to incorrect condition (my fault), which caused some downstream LTO crashes as reported by @mveriksson in https://github.com/llvm/llvm-project/commit/4feae05c6abda364a9295aecfa600d7d4e7dfeb6#r142466703

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread via cfe-commits
@@ -251,6 +251,9 @@ Resolutions to C++ Defect Reports - P0522 implementation is enabled by default in all language versions, and provisional wording for CWG2398 is implemented. +- Require a template argument list after a template keyword. cor3ntin wrote: ``

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread via cfe-commits
@@ -3026,13 +3027,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-30 Thread via cfe-commits
@@ -1404,7 +1404,11 @@ namespace cwg95 { // cwg95: 3.3 // expected-note@#cwg95-C-f {{implicitly declared private here}} } +<<< HEAD:clang/test/CXX/drs/cwg0xx.cpp namespace cwg96 { // cwg96: no +=== +namespace dr96 { // dr96: sup P1787 +>>> c639768eef90 (change

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-30 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > So After we have formed a TemplateSpecializationType, we are done with the > NNS. We keep it around in an ElaboratedType for type sugar only, it should > not be needed to compile the program correctly anymore. > > So I think this solution violates one important aspect of our AS

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
https://github.com/alexander-shaposhnikov updated https://github.com/llvm/llvm-project/pull/93783 >From 50a524b17ce31e1e781a480c2cdf10a9153f9b9c Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Thu, 30 May 2024 08:15:44 + Subject: [PATCH] [Clang][Sanitizers] Add numerical sanitiz

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
@@ -285,6 +285,9 @@ def SanitizeHWAddress : EnumAttr<"sanitize_hwaddress", [FnAttr]>; /// MemTagSanitizer is on. def SanitizeMemTag : EnumAttr<"sanitize_memtag", [FnAttr]>; +/// NumericalStabilitySanitizer is on. +def SanitizeNumericalStability : EnumAttr<"sanitize_numericals

[clang] [llvm] [Clang][Sanitizers] Add numerical sanitizer (PR #93783)

2024-05-30 Thread Alexander Shaposhnikov via cfe-commits
https://github.com/alexander-shaposhnikov ready_for_review https://github.com/llvm/llvm-project/pull/93783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-30 Thread Stefan Gränitz via cfe-commits
weliveindetail wrote: > Looks like you already implemented it. Nice. Well, it's gonna be a bit more churn. Eventually, it will reduce coverage for the incremental features in the frontend that are independent from the JIT. To be honest, I don't mind because none of the targets seem relevant fo

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

2024-05-30 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: The problem with `-fallow-argument-mismatch` has already been reported to the MPICH project maintainers, https://github.com/pmodels/mpich/issues/6869 therefore I'm going to close this PR. https://github.com/llvm/llvm-project/pull/91611 ___

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

2024-05-30 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/91611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits
@@ -24,6 +44,103 @@ using enum E; #endif } +namespace cwg2627 { // cwg2627: 19 +#if __cplusplus >= 202002L +struct C { + long long i : 8; + friend auto operator<=>(C, C) = default; +}; + +void f() { + C x{1}, y{2}; + static_cast(x <=> y); + static_cast(x.i <=> y.i); +} +

[clang] [clang] Add another test case for CWG78 (PR #93708)

2024-05-30 Thread via cfe-commits
cor3ntin wrote: Hum, so with some help, I've realized that zero-initialization, and default-initialization _both_ occur, in that order (and the later is not valid) https://eel.is/c++draft/dcl.init#general-12 https://eel.is/c++draft/dcl.init#general-8.sentence-2 ```cpp int foo; // ok, foo == 0

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/93676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s + +void f1(void) { + int x, y, z[10]; + int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point into the same array is undefined behavior}} + d = z - &y;

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.PointerSub -verify %s + +void f1(void) { + int x, y, z[10]; + int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point into the same array is undefined behavior}} + d = z - &y;

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I'd say it looks pretty good. Objectively speaking it improves the TP rate. I have compared these reports against the constant interpreters of clang and gcc to see if in constexpr context which of these expression would trigger "UB" there. I found I think

[clang] b2bd024 - [CGExprAgg] Don't create zero index GEP

2024-05-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-05-30T11:47:07+02:00 New Revision: b2bd024384b484647da9fd9863bf6f77b5731949 URL: https://github.com/llvm/llvm-project/commit/b2bd024384b484647da9fd9863bf6f77b5731949 DIFF: https://github.com/llvm/llvm-project/commit/b2bd024384b484647da9fd9863bf6f77b5731949.diff

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-30 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: @FreddyLeaf This is corrupting git checkouts on windows - please can you revert ? https://github.com/llvm/llvm-project/pull/92338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang] Add another test case for CWG78 (PR #93708)

2024-05-30 Thread via cfe-commits
cor3ntin wrote: We should test something like that ```cpp struct S { S(); }; S s; const S s ``` Here. The IR should should that s is zero initialized (before calling S::S()) https://github.com/llvm/llvm-project/pull/93708 ___ cfe-commits mail

[clang] [llvm] [X86] Support EGPR for inline assembly. (PR #92338)

2024-05-30 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Should be fixed by https://github.com/llvm/llvm-project/pull/93794 https://github.com/llvm/llvm-project/pull/92338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4310988 - [clang-repl] Even more tests create the Interpreter and must check host JIT support 2 (#84758)

2024-05-30 Thread Stefan Gränitz via cfe-commits
Author: Stefan Gränitz Date: 2024-05-30T11:52:15+02:00 New Revision: 4310988991b46c9a35f60abc27a08ee10309a50c URL: https://github.com/llvm/llvm-project/commit/4310988991b46c9a35f60abc27a08ee10309a50c DIFF: https://github.com/llvm/llvm-project/commit/4310988991b46c9a35f60abc27a08ee10309a50c.diff

[clang] [clang][analyzer] Improved PointerSubChecker (PR #93676)

2024-05-30 Thread Balázs Kéri via cfe-commits
@@ -44,24 +44,30 @@ void PointerSubChecker::checkPreStmt(const BinaryOperator *B, const MemRegion *LR = LV.getAsRegion(); const MemRegion *RR = RV.getAsRegion(); - - if (!(LR && RR)) -return; - - const MemRegion *BaseLR = LR->getBaseRegion(); - const MemRegion *Bas

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-30 Thread Stefan Gränitz via cfe-commits
weliveindetail wrote: @jakeegan Thanks for reporting! Should be fixed now. Hope we caught them all 🤞 https://github.com/llvm/llvm-project/pull/84758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] [RISCV] Add B extension (PR #76893)

2024-05-30 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76893 >From a780efe3e297fe59c5521ea5387dda12905a4423 Mon Sep 17 00:00:00 2001 From: wangpc Date: Thu, 4 Jan 2024 13:05:53 +0800 Subject: [PATCH] [RISCV] Add B extension It seems that we have `B` extension again: htt

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I join Donát, and I agree that this looks good as it is. I had a handful of final remarks but I have no strong opinion on any of the raised points. Merge this, once you considered them and took action if you agreed. https://github.com/llvm

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -1730,6 +1721,21 @@ def UnixAPIPortabilityChecker : Checker<"UnixAPI">, } // end optin.portability + +//===--===// +// Taint checkers. +//===

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/92420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -938,6 +938,53 @@ optin.portability.UnixAPI " Finds implementation-defined behavior in UNIX/Posix functions. +.. _optin-taint-TaintAlloc: + +optin.taint.TaintAlloc (C, C++) steakhal wrote: I was thinking of suggesting `TaintedAlloc`

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -1695,6 +1707,12 @@ MallocChecker::processNewAllocation(const CXXAllocatorCall &Call, // MallocUpdateRefState() instead of MallocMemAux() which breaks the // existing binding. SVal Target = Call.getObjectUnderConstruction(); + if (Call.getOriginExpr()->isArray()) { +

[clang] [analyzer] New optin.taint.TaintAlloc checker for catching unbounded memory allocation calls (PR #92420)

2024-05-30 Thread Balazs Benics via cfe-commits
@@ -938,6 +938,53 @@ optin.portability.UnixAPI " Finds implementation-defined behavior in UNIX/Posix functions. +.. _optin-taint-TaintAlloc: + +optin.taint.TaintAlloc (C, C++) +""" + +This checker warns for cases when the ``s

[clang] [llvm] [RISCV] Add B extension (PR #76893)

2024-05-30 Thread Pengcheng Wang via cfe-commits
wangpc-pp wrote: Ping. The B extension has been ratified and I hava rebased this PR. https://github.com/llvm/llvm-project/pull/76893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][tests] Add test for a limitation of alpha.unix.Bloc… (PR #93799)

2024-05-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 created https://github.com/llvm/llvm-project/pull/93799 …kInCriticalSection checker Updated the documentation in `checkers.rst` to include an example of how `trylock` function is handled. Added a new test for a scenario where `pthread_mutex_trylock` is used, demon

[clang] [clang][analyzer][tests] Add test for a limitation of alpha.unix.Bloc… (PR #93799)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-static-analyzer-1 Author: Endre Fülöp (gamesh411) Changes …kInCriticalSection checker Updated the documentation in `checkers.rst` to include an example of how `trylock` function is handled. Added a new test for a scenar

[clang] [clang][analyzer][tests] Add test for a limitation of alpha.unix.Bloc… (PR #93799)

2024-05-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/93799 From 6cc7b93783993e0e7f21124f2d640cb92484faff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 30 May 2024 11:12:59 +0200 Subject: [PATCH] [clang][analyzer][NFC] Add test for a limi

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Alex Voicu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] 1d57594 - [Clang][AArch64] NFC: Remove -DTEST_SME from RUN lines

2024-05-30 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-05-30T10:25:27Z New Revision: 1d57594d3dce3c7605a414dfecf8b06b3b62c40f URL: https://github.com/llvm/llvm-project/commit/1d57594d3dce3c7605a414dfecf8b06b3b62c40f DIFF: https://github.com/llvm/llvm-project/commit/1d57594d3dce3c7605a414dfecf8b06b3b62c40f.diff L

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-30 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. > I'm not 100% sure about release-notes entry. If it shouldn't say that check > is restricted now to zero-argument size/length. I'd use the release note as it is. Or what is your concern with it? https://github.com/llvm/llvm-project/pull/

[clang] 8eb0945 - [Clang][AArch64] NFC: Simplify checkArmStreamingBuiltin.

2024-05-30 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-05-30T10:26:14Z New Revision: 8eb0945373173213e7454a475f6e227da12d6d3a URL: https://github.com/llvm/llvm-project/commit/8eb0945373173213e7454a475f6e227da12d6d3a DIFF: https://github.com/llvm/llvm-project/commit/8eb0945373173213e7454a475f6e227da12d6d3a.diff L

[clang] [X86]Add support for _outp{|w|d} (PR #93774)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi updated https://github.com/llvm/llvm-project/pull/93774 >From 38359132ea0b3b56900ba48827c86a93c017223a Mon Sep 17 00:00:00 2001 From: Malay Sanghi Date: Wed, 29 May 2024 22:40:47 -0700 Subject: [PATCH 1/3] Add support for _outp{|w|d} --- clang/lib/Headers/intrin

[clang] [X86]Add support for _outp{|w|d} (PR #93774)

2024-05-30 Thread Malay Sanghi via cfe-commits
@@ -63,6 +63,91 @@ unsigned __int64 test__emulu(unsigned int a, unsigned int b) { // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] +// +// CHECK-I386-LABEL: define dso_local noundef i32 @test_outp( +// CHECK-I386-SAME: i16 noundef zeroext [[PORT:

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-05-30 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.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: Apa

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sander de Smalen (sdesmalen-arm) Changes PR #76975 added 'IsStreamingOrSVE2p1' to emit a diagnostic when a builtin marked with 'IsStreamingOrSVE2p1' is used in a non-streaming function that is not compiled with `+sve2p1`. The problem is a

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-30 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: > > Looks like you already implemented it. Nice. > > Well, it's gonna be a bit more churn. Eventually, it will reduce coverage for > the incremental features in the

[clang] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi created https://github.com/llvm/llvm-project/pull/93804 support _inp, _inpw, _inpd, inp, inpw. These functions were removed from the Windows runtime library, but aare still supported for kernel mode development. >From de79bf75b68825440b939f030e1d659d26f3d2ea Mon

[clang] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Malay Sanghi (MalaySanghi) Changes support _inp, _inpw, _inpd, inp, inpw. These functions were removed from the Windows runtime library, but aare still supported for kernel mode development. --- Full diff: https://github.com/llvm/ll

[clang] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Malay Sanghi (MalaySanghi) Changes support _inp, _inpw, _inpd, inp, inpw. These functions were removed from the Windows runtime library, but aare still supported for kernel mode development. --- Full diff: https://github.com/llvm/llvm-pro

[clang] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
MalaySanghi wrote: This could probably have been a part of https://github.com/llvm/llvm-project/pull/93774 . If that's preferred, I'll add this change as a new commit to that PR. https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing

[clang] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
MalaySanghi wrote: tag @phoebewang @FreddyLeaf @RKSimon for review https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add B extension (PR #76893)

2024-05-30 Thread Craig Topper via cfe-commits
@@ -920,8 +920,8 @@ void RISCVISAInfo::updateImplication() { } static constexpr StringLiteral CombineIntoExts[] = { -{"zk"},{"zkn"}, {"zks"}, {"zvkn"}, {"zvknc"}, -{"zvkng"}, {"zvks"}, {"zvksc"}, {"zvksg"}, +{"b"}, {"zk"},{"zkn"}, {"zks"}, {"zvkn

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-05-30 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/93809 This is the outcome of the discussions we had in https://discourse.llvm.org/t/rfc-lldb-handling-no-unique-address-in-lldb/77483 To summarize, LLDB creates AST nodes by parsing debug-info and hands those off t

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) Changes This is the outcome of the discussions we had in https://discourse.llvm.org/t/rfc-lldb-handling-no-unique-address-in-lldb/77483 To summarize, LLDB creates AST nodes by parsing debug-info and hands those off

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Michael Buch (Michael137) Changes This is the outcome of the discussions we had in https://discourse.llvm.org/t/rfc-lldb-handling-no-unique-address-in-lldb/77483 To summarize, LLDB creates AST nodes by parsing debug-info and hands

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-05-30 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/93809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Add support for MS inp functions. (PR #93804)

2024-05-30 Thread Malay Sanghi via cfe-commits
https://github.com/MalaySanghi edited https://github.com/llvm/llvm-project/pull/93804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >