[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -1125,10 +1125,10 @@ class CommonTypeTableInfo class TagTableInfo : public CommonTypeTableInfo { public: unsigned getUnversionedInfoSize(const TagInfo ) { -return 2 + (TI.SwiftImportAs ? TI.SwiftImportAs->size() : 0) + - 2 + (TI.SwiftRetainOp ?

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread via cfe-commits
@@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f(); // expected-note {{instantiation of}} g(); g(); h(); // expected-note {{instantiation of}} }

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/90064 >From f0394cfaf4df3881809fdce7882bda3006951805 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 25 Apr 2024 15:19:09 +0100 Subject: [PATCH] [APINotes] Allow annotating a C++ type as non-copyable in Swift

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -527,6 +527,13 @@ class TagTableInfo Info.EnumExtensibility = static_cast((Payload & 0x3) - 1); +uint8_t Copyable = +endian::readNext(Data); +if (Copyable == 1) + Info.setSwiftCopyable(std::optional(false)); +else if (Copyable == 2)

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
@@ -1146,6 +1146,12 @@ class TagTableInfo : public CommonTypeTableInfo { writer.write(Flags); +if (auto Copyable = TI.isSwiftCopyable()) { egorzhdan wrote: Fixed https://github.com/llvm/llvm-project/pull/90064

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-25 Thread Troy Butler via cfe-commits
https://github.com/Troy-Butler updated https://github.com/llvm/llvm-project/pull/89923 >From cde48906d4b9a08dc436ab94f183c124ee336e5a Mon Sep 17 00:00:00 2001 From: Troy-Butler Date: Wed, 24 Apr 2024 09:23:29 -0400 Subject: [PATCH 1/2] [clang][Lex] Reformat suspicious condition Signed-off-by:

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -908,6 +908,73 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -908,6 +908,73 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -908,6 +908,73 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -131,6 +131,8 @@ C++2c Feature Support - Implemented `P2573R2: = delete("should have a reason"); `_ +- Implemented `P2573R2: = delete("should have a reason"); `_ erichkeane wrote: What is going on

[clang] [llvm] [mlir] Fix mismatches between function parameter definitions and declarations (PR #89512)

2024-04-25 Thread via cfe-commits
NagyDonat wrote: @Troy-Butler I initiated the merge, but it seems that github mangles the email metadata: ![image](https://github.com/llvm/llvm-project/assets/43410265/d783c97f-f5f7-469f-9f77-9689275ea429) (Note that I obscured your email address in this screenshot, but it can be found within

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-25 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > This patch will finally allow us to mark C++17 support in clang as complete. > > This is a continuation of the review process from an [old PR in > phab](https://reviews.llvm.org/D109496). > > Recap: The original patch from phab initially contained no workarounds / >

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-25 Thread Troy Butler via cfe-commits
Troy-Butler wrote: I see that the build has failed - what do I need to do to fix this? https://github.com/llvm/llvm-project/pull/89923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CMake][Release] Refactor cache file and use two stages for non-PGO builds (PR #89812)

2024-04-25 Thread Tom Stellard via cfe-commits
tstellar wrote: I've been testing this with #89521. https://github.com/llvm/llvm-project/pull/89812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CMake][Release] Refactor cache file and use two stages for non-PGO builds (PR #89812)

2024-04-25 Thread Tom Stellard via cfe-commits
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/89812 >From 275979816a1de8b16a6c45b5ee2ef4e73c8828ba Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 23 Apr 2024 19:29:04 + Subject: [PATCH] [CMake][Release] Refactor cache file and use two stages for

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread via cfe-commits
@@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f(); // expected-note {{instantiation of}} g(); g(); h(); // expected-note {{instantiation of}} }

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/90064 >From 9eac3a34aa9c48e1ddc715ca04c4380f1d78a876 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 25 Apr 2024 15:19:09 +0100 Subject: [PATCH] [APINotes] Allow annotating a C++ type as non-copyable in Swift

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/90066 https://wg21.link/P2809R3 This is applied as a DR to C++11 (C++98 did not guarantee forward progress and is left untouched) As an extension (and to preserve existing behavior in C), we consider all

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: cor3ntin (cor3ntin) Changes https://wg21.link/P2809R3 This is applied as a DR to C++11 (C++98 did not guarantee forward progress and is left untouched) As an extension (and to preserve existing behavior in C), we consider all

[clang] Delete old broken lit wrapper (PR #90067)

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (ldrumm) Changes Last updated before the monorepo was created[1], this lit wrapper can no longer work. Since it's been broken for so long, I don't think anyone's going to miss it. [1] 22d5360ed04e69: Does people use this? --- Full

[clang] d285e54 - Delete old broken lit runner

2024-04-25 Thread Luke Drummond via cfe-commits
Author: Luke Drummond Date: 2024-04-25T16:06:34+01:00 New Revision: d285e54320e9bc42ea91b28a59a831c58627217a URL: https://github.com/llvm/llvm-project/commit/d285e54320e9bc42ea91b28a59a831c58627217a DIFF: https://github.com/llvm/llvm-project/commit/d285e54320e9bc42ea91b28a59a831c58627217a.diff

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-25 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/89639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
yronglin wrote: > DR changes look good. @erichkeane mind giving CWG650 test a quick look? Thanks for your review! https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %s + +auto&& f1() { + return 42; // expected-error{{returning reference to local temporary object}} +} +const double& f2() { + static int x = 42; + return x; // expected-error{{returning reference to local

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -9950,6 +9950,8 @@ def warn_ret_stack_addr_ref : Warning< def warn_ret_local_temp_addr_ref : Warning< "returning %select{address of|reference to}0 local temporary object">, InGroup; +def err_ret_local_temp_addr_ref : Error< + "returning %select{address of|reference

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 Nit, else LGTM, the CWG issue change seems sensible, as does the rest. https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Thank you working on this. I'm really like this feature! I've a question, > > do we have any further plans to support GNU extension attributes(e.g. > > **attribute**((aligned)))? Although it is not included in the paper. > > No, sorry! > > My goal here is to increase

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread Erich Keane via cfe-commits
@@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f(); // expected-note {{instantiation of}} g(); g(); h(); // expected-note {{instantiation of}} }

[clang-tools-extra] [clang-tidy] Enable C23 support in modernize-use-nullptr (PR #89990)

2024-04-25 Thread via cfe-commits
@@ -269,6 +269,10 @@ Changes in existing checks don't remove parentheses used in ``sizeof`` calls when they have array index accesses as arguments. +- Improved :doc:`modernize-use-nullptr + ` check to include support for + ``C23``, which also has introduced the

[clang] 39ed3c6 - [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (#88427)

2024-04-25 Thread via cfe-commits
Author: Alexandre Ganea Date: 2024-04-25T10:31:45-04:00 New Revision: 39ed3c68e51f1b04fe2890db9006ae1b176b1582 URL: https://github.com/llvm/llvm-project/commit/39ed3c68e51f1b04fe2890db9006ae1b176b1582 DIFF:

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-25 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea closed https://github.com/llvm/llvm-project/pull/88427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Egor Zhdan (egorzhdan) Changes Certain C++ types, such as `std::chrono::tzdb` in libstdc++, are non-copyable, but don't explicitly delete their copy constructor. Instead, they trigger template instantiation errors when trying to call

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan ready_for_review https://github.com/llvm/llvm-project/pull/90064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-25 Thread Troy Butler via cfe-commits
https://github.com/Troy-Butler updated https://github.com/llvm/llvm-project/pull/89923 >From cde48906d4b9a08dc436ab94f183c124ee336e5a Mon Sep 17 00:00:00 2001 From: Troy-Butler Date: Wed, 24 Apr 2024 09:23:29 -0400 Subject: [PATCH 1/3] [clang][Lex] Reformat suspicious condition Signed-off-by:

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-25 Thread via cfe-commits
github-actions[bot] wrote: @sopyb Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] [OpenCL] Put constant initializer globals into constant addrspace (PR #90048)

2024-04-25 Thread Sven van Haastregt via cfe-commits
https://github.com/svenvh created https://github.com/llvm/llvm-project/pull/90048 Place constant initializer globals into the constant address space. Clang generates such globals for e.g. larger array member initializers of classes and then emits copy operations from the global to the

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-25 Thread Erich Keane via cfe-commits
erichkeane wrote: I think I've got everything done you were concerned about. Let me know if you see anything else! https://github.com/llvm/llvm-project/pull/89639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Peter Smith via cfe-commits
smithp35 wrote: No objections from me. I would prefer there not to be a difference for assembly at different optimisation levels. I can't find any evidence that this affects Arm (Thumb to be precise) assembly at all. For example: ``` .text b dest// b.n 2-byte branch

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I see that the build has failed - what do I need to do to fix this? That build failure looks unrelated to your changes, I think it just got caught in a bad state. You can try pushing no changes to the branch to kick off a new build just to be sure, though.

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity , << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Kelvin Li via cfe-commits
kkwli wrote: This change will also break backward compatibility that the old object file that contain `main` can no longer use the new compiler to link with other objects. I think we can put a warning in the release note or something like that to warn users.

[clang] [APINotes] Allow annotating a C++ type as non-copyable in Swift (PR #90064)

2024-04-25 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 697fcd009855a579f756dfe34498a815ed9dc3fd a3ea8c954f3446330314f4b5d1ea42d87761b1c4 --

[clang] Delete old broken lit wrapper (PR #90067)

2024-04-25 Thread via cfe-commits
https://github.com/ldrumm created https://github.com/llvm/llvm-project/pull/90067 Last updated before the monorepo was created[1], this lit wrapper can no longer work. Since it's been broken for so long, I don't think anyone's going to miss it. [1] 22d5360ed04e69: Does people use this?

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-25 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 9cbf96ad5b6fe777bf5acd43b65abfb062381f8c db61b6d6e2c5ff75ffcf43874bfed60243e4e671 --

[clang-tools-extra] d3f92e3 - [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (#85572)

2024-04-25 Thread via cfe-commits
Author: Sopy Date: 2024-04-25T17:02:45+02:00 New Revision: d3f92e30bbd5c295a639f207b9ac92198d538fb3 URL: https://github.com/llvm/llvm-project/commit/d3f92e30bbd5c295a639f207b9ac92198d538fb3 DIFF: https://github.com/llvm/llvm-project/commit/d3f92e30bbd5c295a639f207b9ac92198d538fb3.diff LOG:

[clang] Delete old broken lit wrapper (PR #90067)

2024-04-25 Thread via cfe-commits
ldrumm wrote: ``` d3f92e30bbd5..d285e54320e9 main -> main https://github.com/llvm/llvm-project/pull/90067 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Delete old broken lit wrapper (PR #90067)

2024-04-25 Thread via cfe-commits
https://github.com/ldrumm closed https://github.com/llvm/llvm-project/pull/90067 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread via cfe-commits
@@ -131,6 +131,8 @@ C++2c Feature Support - Implemented `P2573R2: = delete("should have a reason"); `_ +- Implemented `P2573R2: = delete("should have a reason"); `_ cor3ntin wrote: Good question!

[clang] [llvm] [coro] Lower `llvm.coro.await.suspend.handle` to resume with tail call (PR #89751)

2024-04-25 Thread Mircea Trofin via cfe-commits
@@ -1056,6 +1083,25 @@ void CoroCloner::create() { // Set up the new entry block. replaceEntryBlock(); + // Turn symmetric transfers into musttail calls. + for (CallInst *ResumeCall : Shape.SymmetricTransfers) { +ResumeCall = cast(VMap[ResumeCall]); +

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/89906 >From e87546f2bc0c7d213b6c1f2b414e0ce5335b3e47 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 24 Apr 2024 11:53:28 +0200 Subject: [PATCH 1/2] [Clang] Implement C++26 Attributes for Structured

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread via cfe-commits
ldrumm wrote: @compnerd I just realised I didn't respond to your concern. Apologies. > I think that the concern that I have is that do we have sufficient testing > for supporting line-ending dependent behaviour in the compiler? For the first part: I don't know that it matters, since this

[clang] [clang][analyzer] Fix alpha.unix.BlockInCriticalSection for CTU (PR #90030)

2024-04-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. > In CTU there is not always an AnalysisDeclContext for a given call. Why? Could you demonstrate the fix in a test? https://github.com/llvm/llvm-project/pull/90030 ___ cfe-commits

[clang] [clang] Add test for CWG2149 "Brace elision and array length deduction" (PR #90079)

2024-04-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/90079 This patch adds test for [CWG2149](https://cplusplus.github.io/CWG/issues/2149.html), following [P3106R1](https://wg21.link/p3106R1) "Clarifying rules for brace elision in aggregate initialization" and a

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread via cfe-commits
ldrumm wrote: > I'll add a comment to the testing infrastructure page to be mindful of how > line endings are storedand link to the .gitattributes documentation. Does > that sound enough? Added

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/11] implement binding type error for t/cbuffers and

[clang] [llvm] [RISCV] Teach .option arch to support experimental extensions. (PR #89727)

2024-04-25 Thread Yeting Kuo via cfe-commits
yetingk wrote: > Does this disable use of experimental extensions for a `.option arch` in an > inline assembly block without -menable-experimental-extensions. No. my patch could not block the case. I will try to think this problem after my sleep.

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-25 Thread via cfe-commits
dyung wrote: Hi, we have an internal test that checks that compiling with and without optnone at O0 does not change the code generated by the compiler, and one of the tests we have did change which I bisected back to your change. The test consists of the following code: ```c++ #include

[clang] [Driver] Restore compiler-rt arch suffix for PS and Windows (PR #89775)

2024-04-25 Thread Tobias Hieta via cfe-commits
tru wrote: > > LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on > > > > I'm unable to find what code this affects. I don't see it mentioned anywhere > in clang/lib or clang/include. > > > > It does seem like it should control the behavior of > `ToolChain::getCompilerRT`; where I had added the

[clang] [Driver] Restore compiler-rt arch suffix for PS and Windows (PR #89775)

2024-04-25 Thread Tobias Hieta via cfe-commits
tru wrote: I think I suggested that we should make the CMake variable change the driver behaviour to reflect the setting in order to remove unexpected fallbacks and that the vendor could select the layout. I still think that's probably the better solution.

[clang] [llvm] [RISCV] Teach .option arch to support experimental extensions. (PR #89727)

2024-04-25 Thread Craig Topper via cfe-commits
topperc wrote: Does this disable use of experimental extensions for a `.option arch` in an inline assembly block? https://github.com/llvm/llvm-project/pull/89727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -9950,6 +9950,8 @@ def warn_ret_stack_addr_ref : Warning< def warn_ret_local_temp_addr_ref : Warning< "returning %select{address of|reference to}0 local temporary object">, InGroup; +def err_ret_local_temp_addr_ref : Error< + "returning %select{address of|reference

[clang] [Driver] Restore compiler-rt arch suffix for PS and Windows (PR #89775)

2024-04-25 Thread Paul T Robinson via cfe-commits
pogo59 wrote: > LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on I'm unable to find what code this affects. I don't see it mentioned anywhere in clang/lib or clang/include. It does seem like it should control the behavior of `ToolChain::getCompilerRT`; where I had added the Windows/PS check, seems

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity , << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread via cfe-commits
@@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f(); // expected-note {{instantiation of}} g(); g(); h(); // expected-note {{instantiation of}} }

[clang-tools-extra] [clang-tidy] Enable C23 support in modernize-use-nullptr (PR #89990)

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

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: `createAMDGPUELFStreamer` ignores `RelaxAll`, so this appears to be x86-only. There may be some clean-up opportunities. https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [RISCV] Add generic CPUs for profiles (PR #84877)

2024-04-25 Thread Alex Bradbury via cfe-commits
asb wrote: We discussed again in the sync-up call to try to move this forwards and per a discussion with @topperc and @preames were wondering if relying on -mattr and a corresponding feature for the profile might be the better approach after all. * There's not a lot of instances of this, but I

[clang] [clang] Add test for CWG2149 "Brace elision and array length deduction" (PR #90079)

2024-04-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: >Can you add examples 14, 16, 17, 18 of the paper? I'll add them to conformance test suite in a subsequent PR. They don't belong here, as the issue is about deducing array length from brace initializer, but the examples you're listing are focusing on various aspects of how

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > @compnerd I just realised I didn't respond to your concern. Apologies. > > > I think that the concern that I have is that do we have sufficient testing > > for supporting line-ending dependent behaviour in the compiler? > > For the first part: I don't know that it matters,

[clang] [llvm] [RISCV] Add generic CPUs for profiles (PR #84877)

2024-04-25 Thread Pengcheng Wang via cfe-commits
wangpc-pp wrote: > Do you see any disadvantage to going back to adding a feature for the > profiles? Of course not, I will revise this patch tomorrow. Thanks for discussing this! (I missed the sync-up meeting because I forgot the daylight saving...)

[clang-tools-extra] [run-clang-tidy.py] Refactor, add progress indicator, add type hints (PR #89490)

2024-04-25 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: @PiotrZSL @carlosgalvezp Any thoughts on this change? https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity , << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[clang] [llvm] [clang][hlsl][dxil][spirv][x86] Add tan intrinsic (PR #90088)

2024-04-25 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl created https://github.com/llvm/llvm-project/pull/90088 This change is an implementation of #87367's investigation on supporting IEEE math operations as intrinsics. Which was discussed in this RFC: https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294 All

[libclc] [libclc] Add initial LIT tests (PR #87989)

2024-04-25 Thread Fraser Cormack via cfe-commits
@@ -1,3 +1,6 @@ -__kernel void foo(int *i) { +// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s frasercrmck wrote: That's true, but I'm still sceptical that we can make the tests simple enough for `update_cc_test_checks` to be viable. We'd have to embed

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity , << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-25 Thread via cfe-commits
@@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f(); // expected-note {{instantiation of}} g(); g(); h(); // expected-note {{instantiation of}} }

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

2024-04-25 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Please note: the guidelines do not require one to replace [] with at(), that's just one of the possible solutions. Actually at() is banned in many codebases where exceptions are banned. It would be good to make this fix-it opt-in, configurable via option, so the check

[clang] [Driver] Restore compiler-rt arch suffix for PS and Windows (PR #89775)

2024-04-25 Thread Nico Weber via cfe-commits
nico wrote: > Again, clangDriver does file probing in various places. This is the only place where we probe link-time inputs for compile-time decisions as far as I know. https://github.com/llvm/llvm-project/pull/89775 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Enable C23 support in modernize-use-nullptr (PR #89990)

2024-04-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/89990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG2149 "Brace elision and array length deduction" (PR #90079)

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch adds test for [CWG2149](https://cplusplus.github.io/CWG/issues/2149.html), following [P3106R1](https://wg21.link/p3106R1) "Clarifying rules for brace elision in aggregate initialization"

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: > .text > b dest// b.n 2-byte branch > b dest2 // b.w 4-byte branch > nop > dest: > nop > .space 2048 > dest2: > nop Thanks for checking. Confirmed no impact to ARM because

[clang] [clang] Add test for CWG2149 "Brace elision and array length deduction" (PR #90079)

2024-04-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Status of 2149 changed just yesterday to say DR per 2024 Tokyo straw poll. That's where the discrepancy between official `cwg_index.html` and CWG GitHub repo comes (that I link in the description). https://github.com/llvm/llvm-project/pull/90079

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

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

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1837681 - [Driver] Don't default to -mrelax-all for non-RISCV -O0

2024-04-25 Thread via cfe-commits
Author: Fangrui Song Date: 2024-04-25T09:27:55-07:00 New Revision: 18376810f359dbd39d2a0aa0ddfc0f7f50eac199 URL: https://github.com/llvm/llvm-project/commit/18376810f359dbd39d2a0aa0ddfc0f7f50eac199 DIFF: https://github.com/llvm/llvm-project/commit/18376810f359dbd39d2a0aa0ddfc0f7f50eac199.diff

[clang] [clang] Add test for CWG2149 "Brace elision and array length deduction" (PR #90079)

2024-04-25 Thread via cfe-commits
cor3ntin wrote: Can you add examples 14, 16, 17, 18 of the paper? I'd be if they are only tested in C++11+ modes Then we can mark the paper as implemented (bonus point for finding the oldest conforming version) https://github.com/llvm/llvm-project/pull/90079

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread via cfe-commits
cor3ntin wrote: changes to `clang/test/CXX/lex/lex.literal/lex.string/p4.cpp` should be reverted (it's a CRLF related test) https://github.com/llvm/llvm-project/pull/86318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-04-25 Thread Saleem Abdulrasool via cfe-commits
compnerd wrote: > changes to `clang/test/CXX/lex/lex.literal/lex.string/p4.cpp` should be > reverted (it's a CRLF related test) This is the type of problems that I am concerned about. We certainly have some tests which are line-ending sensitive, and each test should be audited before we make

[clang] [llvm] [clang][hlsl][dxil][spirv][x86] Add tan intrinsic (PR #90088)

2024-04-25 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/90088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add fix-its to `readability-avoid-return-with-void-value` check (PR #81420)

2024-04-25 Thread Mike Rice via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= Message-ID: In-Reply-To: @@ -42,10 +44,30 @@ void AvoidReturnWithVoidValueCheck::check( const auto *VoidReturn = Result.Nodes.getNodeAs("void_return"); if (IgnoreMacros

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/89477 >From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 19 Apr 2024 17:53:52 -0700 Subject: [PATCH 1/3] Clean up denormal handling with -ffp-model, -ffast-math,

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-25 Thread Eli Friedman via cfe-commits
@@ -908,6 +908,73 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if

[clang] [Clang][Sema] Fix warnings after #84050 (PR #90104)

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/90104.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaExprMember.cpp (-1) - (modified) clang/lib/Sema/SemaLookup.cpp (+1-1)

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix warnings after #84050 (PR #90104)

2024-04-25 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/90104 None >From 3999d7bab286fd3228254700514695610c1a3bee Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 25 Apr 2024 15:03:59 -0400 Subject: [PATCH] [Clang][Sema] Fix warnings after #84050 ---

[clang] Clean up denormal handling with -ffp-model, -ffast-math, etc. (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
andykaylor wrote: I've updated this change to account for the changes made in https://github.com/llvm/llvm-project/pull/80475 and made corresponding updated to the PR title and description. https://github.com/llvm/llvm-project/pull/89477 ___

[clang] Clean up denormal handling with -ffp-model, -ffast-math, etc. (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   >