[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,469 @@ +//===--- APINotesManager.cpp - Manage API Notes Files -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/72389 >From 9e171fa5e51a1c6572938da815f9d129f49fb046 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 15 Nov 2023 13:46:54 + Subject: [PATCH] [APINotes] Upstream APINotesManager This upstreams more of the Cl

[clang] [APINotes] Upstream APINotesManager (PR #72389)

2023-11-15 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,469 @@ +//===--- APINotesManager.cpp - Manage API Notes Files -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang] Remove fixed point arithmetic error (PR #71884)

2023-11-15 Thread John McCall via cfe-commits
rjmccall wrote: I definitely don't think we should be handling this in the lexer by trying to retroactively make this a keyword. I was just thinking that we might have some sort of parser-level recovery for e.g. `unrecognized_identifier_t x = 5;` that might guess that `unrecognized_identifier_

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-15 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/72346 >From f238608b792f69b93eb445ee596125f3e20acf39 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 14 Nov 2023 20:52:21 -0800 Subject: [PATCH 1/5] [Clang] Fix ICE caused by mishandling template speciali

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
@@ -5031,7 +5031,12 @@ void RecordDecl::completeDefinition() { /// This which can be turned on with an attribute, pragma, or the /// -mms-bitfields command-line option. bool RecordDecl::isMsStruct(const ASTContext &C) const { - return hasAttr() || C.getLangOpts().MSBitfields =

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
https://github.com/DanShaders edited https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
https://github.com/DanShaders edited https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-15 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: @AaronBallman , mind providing some feedback on this patch? I think this can solve #70375 https://github.com/llvm/llvm-project/pull/72346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #68932)

2023-11-15 Thread Jun Wang via cfe-commits
jwanggit86 wrote: > > So, while it's possible to create a combined option, using a separate > > option also makes sense. Do we generally try to avoid creating new > > command-line options? > > Looking again, I see they are different and unrelated. I don't really > understand why we have amdgp

[clang] [clang-tools-extra] [llvm] [coro][pgo] Do not insert counters in the `suspend` block (PR #71262)

2023-11-15 Thread Mircea Trofin via cfe-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/71262 >From 184936c339ea73ccfc4349e023ff165aa9f8392e Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Fri, 3 Nov 2023 18:19:15 -0700 Subject: [PATCH 1/4] [coro][pgp] Do not insert counters in the `suspend` block If

[lldb] [llvm] [clang-tools-extra] [libcxx] [clang] [mlir] [compiler-rt] [lld] [libc] [flang] [MLIR] Enable GPU Dialect to SYCL runtime integration (PR #71430)

2023-11-15 Thread Sang Ik Lee via cfe-commits
@@ -61,6 +63,7 @@ registerAllGPUToLLVMIRTranslations(DialectRegistry ®istry) { registerLLVMDialectTranslation(registry); registerNVVMDialectTranslation(registry); registerROCDLDialectTranslation(registry); + registerSPIRVDialectTranslation(registry); si

[clang] [NFC] Cleanup and sort hlsl_intrinsics.h (PR #72414)

2023-11-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/72414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [AMDGPU] Fix GCNRewritePartialRegUses pass: vector regclass is selected instead of scalar. (PR #69957)

2023-11-15 Thread Valery Pykhtin via cfe-commits
vpykhtin wrote: > I think the code change looks fine. I left a few questions inline about > existing code -- you don't necessarily need to address these. > > Could you regenerate the tests as a separate NFC commit (or PR), so this PR > only shows test changes from the code change? Thank you f

[clang] [llvm] [clang-tools-extra] [AMDGPU] Fix GCNRewritePartialRegUses pass: vector regclass is selected instead of scalar. (PR #69957)

2023-11-15 Thread Valery Pykhtin via cfe-commits
@@ -425,29 +414,41 @@ bool GCNRewritePartialRegUses::rewriteReg(Register Reg) const { return false; for (MachineOperand &MO : Range) { vpykhtin wrote: Yes, it avoids any processing for unsuitable registers. Replaced the loop with any_of. https://gith

[clang] [clang-tools-extra] [llvm] [AMDGPU] Fix GCNRewritePartialRegUses pass: vector regclass is selected instead of scalar. (PR #69957)

2023-11-15 Thread Valery Pykhtin via cfe-commits
@@ -425,29 +414,41 @@ bool GCNRewritePartialRegUses::rewriteReg(Register Reg) const { return false; for (MachineOperand &MO : Range) { -if (MO.getSubReg() == AMDGPU::NoSubRegister) // Whole reg used, quit. +if (MO.getSubReg() == AMDGPU::NoSubRegister) // Whole r

[llvm] [clang] [clang-tools-extra] [AMDGPU] Fix GCNRewritePartialRegUses pass: vector regclass is selected instead of scalar. (PR #69957)

2023-11-15 Thread Valery Pykhtin via cfe-commits
@@ -1,32 +1,31 @@ # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -mtriple=amdgcn-amd-amdhsa -amdgpu-enable-rewrite-partial-reg-uses=true -verify-machineinstrs -start-before=rename-independent-subregs -stop-after=rewrite-partial-reg-use

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
https://github.com/DanShaders edited https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] [coro][pgo] Do not insert counters in the `suspend` block (PR #71262)

2023-11-15 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. Please also update the comment about tail call and symmetric transfer. https://github.com/llvm/llvm-project/pull/71262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [lldb] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

2023-11-15 Thread via cfe-commits
zmodem wrote: Thanks! https://github.com/llvm/llvm-project/pull/71780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread John McCall via cfe-commits
@@ -5031,7 +5031,12 @@ void RecordDecl::completeDefinition() { /// This which can be turned on with an attribute, pragma, or the /// -mms-bitfields command-line option. bool RecordDecl::isMsStruct(const ASTContext &C) const { - return hasAttr() || C.getLangOpts().MSBitfields =

[clang] f0ad2e9 - [Driver] Make use of AddFilePathLibArgs() on NetBSD. (#71371)

2023-11-15 Thread via cfe-commits
Author: Brad Smith Date: 2023-11-15T13:36:16-05:00 New Revision: f0ad2e9fda5f78149198f67461e417d101318df5 URL: https://github.com/llvm/llvm-project/commit/f0ad2e9fda5f78149198f67461e417d101318df5 DIFF: https://github.com/llvm/llvm-project/commit/f0ad2e9fda5f78149198f67461e417d101318df5.diff LO

[clang] [Driver] Make use of AddFilePathLibArgs() on NetBSD. (PR #71371)

2023-11-15 Thread Brad Smith via cfe-commits
https://github.com/brad0 closed https://github.com/llvm/llvm-project/pull/71371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [MS-ABI] create unique vftable name for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread via cfe-commits
https://github.com/jyu2-git updated https://github.com/llvm/llvm-project/pull/71748 >From 3313aca0622da3882a9e5bf304b89f28fecce7fe Mon Sep 17 00:00:00 2001 From: Jennifer Yu Date: Mon, 6 Nov 2023 20:51:39 -0800 Subject: [PATCH 1/3] [SEH] Fix assertin when return scalar value from __try block.

[llvm] [clang] [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72234)

2023-11-15 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: we're seeing debug info verifier issues in Rust with this change, e.g. ``` invalid tag !50 = !DIDerivedType(tag: DW_TAG_imported_declaration, name: "DISCR_EXACT", scope: !37, file: !2, baseType: !51, flags: DIFlagStaticMember, extraData: i64 0) invalid tag !61 = !DIDerivedTy

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
DanShaders wrote: @rjmccall Would you mind merging this then? (I don't have write access) https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [NFC] Cleanup and sort hlsl_intrinsics.h (PR #72414)

2023-11-15 Thread via cfe-commits
@@ -11,557 +11,614 @@ namespace hlsl { -__attribute__((availability(shadermodel, introduced = 6.0))) -__attribute__((clang_builtin_alias(__builtin_hlsl_wave_active_count_bits))) uint -WaveActiveCountBits(bool bBit); +// Note: Functions in this file are sorted alphabetically,

[llvm] [flang] [clang] [clang-tools-extra] [compiler-rt] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 01/23] [clang] Add support for new loop attribute [[clang::code

[clang] [ClangRepl] Type Directed Code Completion (PR #67349)

2023-11-15 Thread Fred Fu via cfe-commits
https://github.com/capfredf updated https://github.com/llvm/llvm-project/pull/67349 >From 2e01c0e7974977d5dd13ef2dcab765c4d714f5ce Mon Sep 17 00:00:00 2001 From: Fred Fu Date: Tue, 29 Aug 2023 11:56:59 -0400 Subject: [PATCH] [ClangRepl] Add type directed code completion to clang-repl use CodeC

[llvm] [flang] [clang] [clang-tools-extra] [compiler-rt] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
@@ -322,6 +322,79 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -7482,3 +7482,26 @@ generation of the other destruction cases, optimizing the above `foo.destroy` to }]; } + +def MSStructDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``ms_struct`` and ``gcc_struct`` attributes request the compiler to ent

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -3643,7 +3643,14 @@ def CFGuard : InheritableAttr, TargetSpecificAttr { def MSStruct : InheritableAttr { let Spellings = [GCC<"ms_struct">]; let Subjects = SubjectList<[Record]>; - let Documentation = [Undocumented]; + let Documentation = [MSStructDocs]; + let Simple

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Dan Klishch via cfe-commits
https://github.com/DanShaders updated https://github.com/llvm/llvm-project/pull/71148 >From 5fb6768149bf2b4e7d74c4874e17dbf4e0e656b7 Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Fri, 3 Nov 2023 21:18:06 -0400 Subject: [PATCH 1/5] [clang] Stub out gcc_struct attribute This commit implements

[clang] [clang] Enable --gcc-install-dir for RISCV baremetal toolchains (PR #71803)

2023-11-15 Thread via cfe-commits
abidh wrote: > Thanks for the pointer. However, the description doesn't appear to have > sufficient information to justify the `--gcc-toolchain=` dependent decision. > A toolchain should be selected completely from the target triple. I think > `RISCVToolChain` should be adjusted to either sele

[clang] Fix to attribute plugins reaching an unreachable (PR #70877)

2023-11-15 Thread Amy Huang via cfe-commits
amykhuang wrote: ping for review? https://github.com/llvm/llvm-project/pull/70877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72234)

2023-11-15 Thread Michael Buch via cfe-commits
Michael137 wrote: > we're seeing debug info verifier issues in Rust with this change, e.g. > > ``` > > invalid tag > > !50 = !DIDerivedType(tag: DW_TAG_imported_declaration, name: "DISCR_EXACT", > scope: !37, file: !2, baseType: !51, flags: DIFlagStaticMember, extraData: > i64 0) > > inv

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,333 @@ +//=- ClangDiagnosticsEmitter.cpp - Generate Clang diagnostics tables -*- 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: Ap

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/68324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'm in favor of the changes in this patch, but precommit CI is currently failing with relevant failures that should be addressed. https://github.com/llvm/llvm-project/pull/68324 ___ cfe-commits mailing list c

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,333 @@ +//=- ClangDiagnosticsEmitter.cpp - Generate Clang diagnostics tables -*- C++ -*- AaronBallman wrote: ```suggestion //=- ClangBuiltinsEmitter.cpp - Generate Clang builtins tables -*- C++ -*- ``` May need to adjust formatting. https://github.c

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,333 @@ +//=- ClangDiagnosticsEmitter.cpp - Generate Clang diagnostics tables -*- 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: Ap

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,121 @@ +//===--- BuiltinsBase.td - common structured used by builtins ---*- 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: Ap

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,121 @@ +//===--- BuiltinsBase.td - common structured used by builtins ---*- 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: Ap

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,121 @@ +//===--- BuiltinsBase.td - common structured used by builtins ---*- 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: Ap

[llvm] [clang] [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72234)

2023-11-15 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: ah I see, that definitely sounds plausible I've also recently done some NFC changes to better catch issues like this in https://github.com/llvm/llvm-project/pull/66295 https://github.com/llvm/llvm-project/pull/72234 ___ cfe-commits ma

[clang-tools-extra] [compiler-rt] [clang] [llvm] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 01/24] [clang] Add support for new loop attribute [[clang::code

[llvm] [clang] [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72234)

2023-11-15 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: actually I think the caller is in Rust, so perhaps we should just update Rust instead. but making some of these params more strongly typed would be good https://github.com/llvm/llvm-project/pull/72234 ___ cfe-commits mailing list cfe-c

[llvm] [clang] [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72234)

2023-11-15 Thread Michael Buch via cfe-commits
Michael137 wrote: Is it possible that this is to be fixed at the callsites in the rust frontend? Dont think i missed any callers in LLVM (then again I'm not at a PC to confirm this atm) https://github.com/llvm/llvm-project/pull/72234 ___ cfe-commits

[clang] Fix to attribute plugins reaching an unreachable (PR #70877)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. > ping for review? My apologies for the delay! The changes LGTM but there is a precommit CI failure with libc++. As best I can tell, that looks to be a transient issue and not caused by your patch, but it would be good to verify that

[clang-tools-extra] [clang-tidy] bugprone-assert-side-effect non-const operator methods (PR #71974)

2023-11-15 Thread via cfe-commits
https://github.com/schenker updated https://github.com/llvm/llvm-project/pull/71974 >From dabfdee1a982000605e4b33930ba433c63d1684f Mon Sep 17 00:00:00 2001 From: Thomas Schenker Date: Fri, 10 Nov 2023 18:58:26 +0100 Subject: [PATCH 1/4] [clang-tidy] bugprone-assert-side-effect non-const operat

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The attribute bits LGTM, but I added some more reviewers to double-check the driver changes. https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang-tools-extra] [llvm] [coro][pgo] Do not insert counters in the `suspend` block (PR #71262)

2023-11-15 Thread Mircea Trofin via cfe-commits
https://github.com/mtrofin edited https://github.com/llvm/llvm-project/pull/71262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [coro][pgo] Do not insert counters in the `suspend` block (PR #71262)

2023-11-15 Thread Mircea Trofin via cfe-commits
https://github.com/mtrofin closed https://github.com/llvm/llvm-project/pull/71262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MS-ABI] create unique vftable name for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Looks fine now. (You might want to change the title before merging.) https://github.com/llvm/llvm-project/pull/71748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang][Interp] Implement bitwise operations for IntegralAP (PR #71807)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/71807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement bitwise operations for IntegralAP (PR #71807)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but asking for some extra tests. https://github.com/llvm/llvm-project/pull/71807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang][Interp] Implement bitwise operations for IntegralAP (PR #71807)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -157,4 +157,13 @@ namespace Bitfields { // expected-warning {{changes value from 100 to 0}} } +namespace BitOps { + constexpr unsigned __int128 UZero = 0; + constexpr unsigned __int128 Max = ~UZero; + static_assert(Max == ~0, ""); + static_assert

[clang] [clang][Interp] Implement IntegralAP subtraction (PR #71648)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/71648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B edited https://github.com/llvm/llvm-project/pull/72394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. LGTM with a couple of nits. https://github.com/llvm/llvm-project/pull/72394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Artem Belevich via cfe-commits
@@ -12,7 +12,7 @@ extern "C" void host_fn() {} struct Dummy {}; struct S { - S() {} + S() { x = 1; } Artem-B wrote: Can we make the purpose of non-trivial constructor more descriptive, here and in other places? E.g. `S() { static int nontrivial_ctor = 1; }

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Artem Belevich via cfe-commits
@@ -772,6 +772,26 @@ void Sema::maybeAddCUDAHostDeviceAttrs(FunctionDecl *NewD, NewD->addAttr(CUDADeviceAttr::CreateImplicit(Context)); } +// If a trivial ctor/dtor has no host/device +// attributes, make it implicitly host device function. +void Sema::maybeAddCUDAHostDevice

[llvm] [clang-tools-extra] [lldb] [clang] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -627,7 +628,7 @@ class Target : public std::enable_shared_from_this, // used. const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, - const FileSpec *cr

[clang] [clang-tools-extra] [llvm] [lldb] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -244,9 +245,38 @@ SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) { TargetSP target_sp(GetSP()); if (target_sp) { FileSpec filespec(core_file); -FileSystem::Instance().Resolve(filespec); +auto file = FileSystem::Instance().Open( +

[clang] [clang-tools-extra] [lldb] [llvm] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -3174,8 +3174,17 @@ class TargetCreateFormDelegate : public FormDelegate { core_file_directory_spec.SetDirectory(core_file_spec.GetDirectory()); target_sp->AppendExecutableSearchPaths(core_file_directory_spec); -ProcessSP process_sp(target_sp->CreateProcess( -

[clang-tools-extra] [clang] [llvm] [lldb] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/71769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang-tools-extra] [clang] [llvm] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -194,11 +194,12 @@ void ProcessGDBRemote::Terminate() { PluginManager::UnregisterPlugin(ProcessGDBRemote::CreateInstance); } -lldb::ProcessSP ProcessGDBRemote::CreateInstance( -lldb::TargetSP target_sp, ListenerSP listener_sp, -const FileSpec *crash_file_path, boo

[lldb] [clang-tools-extra] [llvm] [clang] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/71769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [llvm] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -427,8 +427,17 @@ class CommandObjectTargetCreate : public CommandObjectParsed { core_file_dir.SetDirectory(core_file.GetDirectory()); target_sp->AppendExecutableSearchPaths(core_file_dir); +auto file = FileSystem::Instance().Open( +core

[clang] [llvm] [clang-tools-extra] [lldb] Add new API in SBTarget for loading core from SBFile (PR #71769)

2023-11-15 Thread Greg Clayton via cfe-commits
@@ -102,10 +102,10 @@ void ProcessKDP::Terminate() { lldb::ProcessSP ProcessKDP::CreateInstance(TargetSP target_sp, ListenerSP listener_sp, - const FileSpec *crash_file_path, +

[clang-tools-extra] [compiler-rt] [flang] [llvm] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang] [compiler-rt] [clang-tools-extra] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -296,10 +296,16 @@ bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, return false; // If this is a C++ record, check the bases first. - if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) + if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) {

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2023-11-15 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan edited https://github.com/llvm/llvm-project/pull/68919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2023-11-15 Thread Amy Kwan via cfe-commits
@@ -1,11 +1,16 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm < %s| FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm < %s | FileCheck %s \ +// RUN: --check-prefix=CHECK-X86 +// RUN: %clang_cc1 -triple ppc64le-linux-gnu -emit-llvm < %s | File

[llvm] [clang] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2023-11-15 Thread Amy Kwan via cfe-commits
https://github.com/amy-kwan commented: Additional group review comments. https://github.com/llvm/llvm-project/pull/68919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2023-11-15 Thread Amy Kwan via cfe-commits
@@ -15,38 +20,57 @@ int main(void) { if (__builtin_cpu_supports("sse4.2")) a("sse4.2"); - // CHECK: [[LOAD:%[^ ]+]] = load i32, ptr getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, ptr @__cpu_model, i32 0, i32 3, i32 0) - // CHECK: [[AND:%[^ ]+]] = and i32 [[LOAD

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/72197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -296,10 +296,16 @@ bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, return false; // If this is a C++ record, check the bases first. - if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) + if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) { --

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! Please be sure to add a release note to `clang/docs/ReleaseNotes.rst` as well so users know about the change in behavior. https://github.com/llvm/llvm-project/pull/72197 ___ cfe-commits m

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -65,3 +65,9 @@ EXTERNC struct SortOfEmpty sort_of_empty_ret(void) { struct SortOfEmpty e; return e; } + +// CHECK-GNU-CXX: define{{.*}} i32 @empty_align_arg(i128 %a.coerce, i32 noundef %b) +struct EmptyAlign { long long int __attribute__((aligned)) : 0; }; -

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -65,3 +65,9 @@ EXTERNC struct SortOfEmpty sort_of_empty_ret(void) { struct SortOfEmpty e; return e; } + +// CHECK-GNU-CXX: define{{.*}} i32 @empty_align_arg(i128 %a.coerce, i32 noundef %b) +struct EmptyAlign { long long int __attribute__((aligned)) : 0; }; +EXTERNC int

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -296,10 +296,16 @@ bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, return false; // If this is a C++ record, check the bases first. - if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) + if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) {

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
@@ -772,6 +772,26 @@ void Sema::maybeAddCUDAHostDeviceAttrs(FunctionDecl *NewD, NewD->addAttr(CUDADeviceAttr::CreateImplicit(Context)); } +// If a trivial ctor/dtor has no host/device +// attributes, make it implicitly host device function. +void Sema::maybeAddCUDAHostDevice

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
@@ -12,7 +12,7 @@ extern "C" void host_fn() {} struct Dummy {}; struct S { - S() {} + S() { x = 1; } yxsamliu wrote: will do https://github.com/llvm/llvm-project/pull/72394 ___ cfe-commits mailing list cfe-commit

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-15 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/72428 Fix #67495, #72198 CC @ADKaster, @ecnelises >From 13b97a2239c93fe528174ec9ecc20f3d3ca49e23 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH] [clang][AST] Invalidate

[libunwind] [libunwind] Fix running tests with MSan (PR #67860)

2023-11-15 Thread Alexander Richardson via cfe-commits
arichardson wrote: > Gentle ping! Sorry for the delay - I was busy with the RISC-V summit last week, hoping to get to this PR later this week. https://github.com/llvm/llvm-project/pull/67860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes Fix #67495, #72198 CC @ADKaster, @ecnelises --- Full diff: https://github.com/llvm/llvm-project/pull/72428.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaDecl.cpp (+9) - (modified) clang/test/AST/as

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/71687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. The changes seem reasonable to me but I think we should start putting some effort in to support _BitInt because I have a sneaking suspicion that will be hard to support with all the power-of-two literals being used, and the more integ

[clang] [clang][Interp] Implement __builtin_bitreverse (PR #71687)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -59,13 +59,54 @@ static void pushInt(InterpState &S, int32_t Val) { llvm_unreachable("Int isn't 16 or 32 bit?"); } -static bool retInt(InterpState &S, CodePtr OpPC, APValue &Result) { - PrimType IntType = getIntPrimType(S); - if (IntType == PT_Sint32) -return Ret(

[clang] [clang][Interp] Implement __builtin_parity (PR #71662)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_clrsb (PR #72243)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/72243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [MS-ABI] skip generate comdat for vftable defined with internal alias. (PR #71748)

2023-11-15 Thread via cfe-commits
https://github.com/jyu2-git edited https://github.com/llvm/llvm-project/pull/71748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -11486,6 +11486,7 @@ bool IntExprEvaluator::CheckReferencedDecl(const Expr* E, const Decl* D) { /// Values returned by __builtin_classify_type, chosen to match the values /// produced by GCC's builtin. +/// The values can be found in gcc/typeclass.h in the GCC repository.

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/72036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/72036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add bitint classification for __builtin_classify_type (PR #72036)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -217,6 +217,8 @@ Non-comprehensive list of changes in this release (e.g., ``uint16x8_t``), this returns the constant number of elements at compile-time. For scalable vectors, e.g., SVE or RISC-V V, the number of elements is not known at compile-time and is determined

[clang] [clang][Interp] Implement __builtin_classify_type (PR #71972)

2023-11-15 Thread Aaron Ballman via cfe-commits
@@ -439,6 +439,194 @@ static bool interp__builtin_popcount(InterpState &S, CodePtr OpPC, return true; } +// Values returned by __builtin_classify_type, chosen to match the values +/// produced by GCC's builtin. +enum class GCCTypeClass { + None = -1, + Void = 0, + Intege

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-15 Thread Rashmi Mudduluru via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \ +// RUN:-fsafe-buffer-usage-suggestions \ +// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +void foo(int * , int *); + +void add_assign_test(unsigned int n, int *a, int y)

<    1   2   3   4   5   6   >