[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] [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] [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 thei

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

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

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

[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] 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] [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 &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if (CGM.get

[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 &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if (CGM.get

[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 &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if (CGM.get

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

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

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

[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] 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! https

[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 https://lists.llvm.org/cgi-bin/ma

[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]); +ResumeCall->

[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 to}0

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

[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] [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 like

[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, << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[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] 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 on

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

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

[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-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][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 ma

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

[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" an

[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 `llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp:

[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 https://list

[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] [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 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] [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 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
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 [here](https://github.com/llvm/llvm-project/blob/1994c29731fde75f075c0605b79a14667bcfb9ac/llvm/docs

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

[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 https://lists.llvm.org/

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

[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. https://github.com/llvm/llvm-project/pull/8972

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

[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] [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...) https://github.com/llvm/llvm-project/pull/84

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

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

[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] [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 exter

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

[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. https://github.com/llvm/llvm-projec

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-25 Thread Alex Voicu via cfe-commits
@@ -0,0 +1,294 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// RUN: %clang_cc1 -triple spirv64-amd-amdhsa -x hip \ +// RUN: -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -emit-llvm %s \ +// RUN: -o - | FileCheck %s + +// RUN: %clang_

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

2024-04-25 Thread via cfe-commits
cor3ntin 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 > ch

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

2024-04-25 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Idea is fine, implementation is lacking critical parts. Please check comments, fix them. If you will have some questions, just ask. https://github.com/llvm/llvm-project/pull/90043 ___

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,32 @@ +//===--- AvoidBoundsErrorsCheck.h - clang-tidy --*- C++ -*-===// +// +// 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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

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

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - cppcoreguidelines-avoid-bounds-errors + +cppcoreguidelines-avoid-bounds-errors += + +This check enforces the `SL.con.3

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - cppcoreguidelines-avoid-bounds-errors + +cppcoreguidelines-avoid-bounds-errors += + +This check enforces the `SL.con.3

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -57,6 +58,8 @@ namespace cppcoreguidelines { class CppCoreGuidelinesModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { +CheckFactories.registerCheck( +"cppcoreguidelines-avoid-bounds-errors"); --

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,66 @@ +namespace std { + template + struct array { +T operator[](unsigned i) { + return T{1}; +} +T at(unsigned i) { + return T{1}; +} + }; + + template + struct unique_ptr { +T operator[](unsigned i) { + return T{1}; +} + };

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

2024-04-25 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,81 @@ +//===--- AvoidBoundsErrorsCheck.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-tools-extra] 8dc7db7 - [clang-tidy] Add clang-tidy check readability-math-missing-parentheses (#84481)

2024-04-25 Thread via cfe-commits
Author: Bhuminjay Soni Date: 2024-04-25T19:19:59+02:00 New Revision: 8dc7db7a24633f55ef28f2ab4b379386a34505f8 URL: https://github.com/llvm/llvm-project/commit/8dc7db7a24633f55ef28f2ab4b379386a34505f8 DIFF: https://github.com/llvm/llvm-project/commit/8dc7db7a24633f55ef28f2ab4b379386a34505f8.diff

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

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

[clang] 39adc8f - [NFC] Generalize ArraySections to work for OpenACC in the future (#89639)

2024-04-25 Thread via cfe-commits
Author: Erich Keane Date: 2024-04-25T10:22:03-07:00 New Revision: 39adc8f423297c5741bb731bb8b1e545d558502c URL: https://github.com/llvm/llvm-project/commit/39adc8f423297c5741bb731bb8b1e545d558502c DIFF: https://github.com/llvm/llvm-project/commit/39adc8f423297c5741bb731bb8b1e545d558502c.diff L

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

2024-04-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed 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] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

2024-04-25 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel updated https://github.com/llvm/llvm-project/pull/80475 >From 971cc613e994a308f939f68247257b65e04c74fa Mon Sep 17 00:00:00 2001 From: Joshua Cranmer Date: Fri, 2 Feb 2024 10:35:29 -0800 Subject: [PATCH 1/5] Disable FTZ/DAZ when compiling shared libraries by de

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

2024-04-25 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: I'm more or less fine with this change, but didn't had time to test it yet. Does it work with python 3.6 ? https://github.com/llvm/llvm-project/pull/89490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[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/3] [Clang] Implement C++26 Attributes for Structured Bindings

[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 Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I don't want this to be considered a comment which blocks the changes if others feel strongly in favor of them, but I'm not really convinced we should do this. The number of problems this patch will solve is approximately zero but the number of potent

[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: > Also, it's a bit funny to have .bat files without CRLF endings given that > they run on Windows. I'm not sure about the funny bit - but certainly dangerous. I've had cmd misinterpret batch files with LF vs CRLF. https://github.com/llvm/llvm-project/pull/86318 ___

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

2024-04-25 Thread Matt Arsenault via cfe-commits
@@ -1,3 +1,6 @@ -__kernel void foo(int *i) { +// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s arsenm wrote: It is essential that clang should know about libclc. libclc exists purely as an extension of the compiler. From the user perspective the opencl builti

[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 &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if (CGM.get

[clang] 63ecd2a - Disable FTZ/DAZ when compiling shared libraries by default. (#80475)

2024-04-25 Thread via cfe-commits
Author: Joshua Cranmer Date: 2024-04-25T13:57:32-04:00 New Revision: 63ecd2a72523fa591aacf54d310478aabcd30d08 URL: https://github.com/llvm/llvm-project/commit/63ecd2a72523fa591aacf54d310478aabcd30d08 DIFF: https://github.com/llvm/llvm-project/commit/63ecd2a72523fa591aacf54d310478aabcd30d08.diff

[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

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

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-25 Thread Xiang Li via cfe-commits
https://github.com/python3kgae updated https://github.com/llvm/llvm-project/pull/89836 >From 4d8c72688656fe3b2ce8817087d8cf7352b5876b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 23 Apr 2024 17:49:02 -0400 Subject: [PATCH 1/3] [HLSL] Support packoffset attribute in AST Add HLSLPackOffset

[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 60191f2bc6cb191b5b256d220a8b1d07093bddd1 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
@@ -908,6 +908,73 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if (CGM.get

[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: > Does it work with Python 3.6? Actually, it can with one single change. `asyncio,run` was introduced in 3.7, and can be replaced. I'll just add this change and a comment. It worked on my 3.6 setup. Let me know if you run into any issues. https://github.com/llvm/llvm-project/p

[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
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From e27931b8a77c49f1c4cd47ca076addbe0ed19d87 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

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

2024-04-25 Thread Serge Pavlov via cfe-commits
spavloff wrote: Hi @dyung. The observed difference is due to the FP contraction turned off if optnone is specified. In O0 this optimization is still applied. As a result, the function with optnone contains separate fadd and fmul, while without this attribute the function contains combined ope

<    1   2   3   4   >