[clang] [CIR] Upstream UnaryDeref support for ComplexType (PR #146757)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream SubstNonTypeTemplateParmExpr support for ComplexType (PR #146755)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for SubstNonTypeTemplateParmExpr (PR #146751)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Introduce IntTypeInterface to allow uniform integer types handling (PR #146660)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Speedup getFileIDLocal with a separate offset table. (PR #146604)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 suggestion, else LGTM. Please make sure aaron gets a chance to look if he wants. https://github.com/llvm/llvm-project/pull/146604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [CIR] Add mlir-translate to CMake (PR #146608)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Speedup getFileIDLocal with a separate offset table. (PR #146604)

2025-07-02 Thread Erich Keane via cfe-commits
@@ -719,6 +719,8 @@ class SourceManager : public RefCountedBase { /// Positive FileIDs are indexes into this table. Entry 0 indicates an invalid /// expansion. SmallVector LocalSLocEntryTable; + /// An in-parallel offset table, merely used for speeding up FileID lookup.

[clang] [clang] Speedup getFileIDLocal with a separate offset table. (PR #146604)

2025-07-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/146604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Fix mlir::ValueRange init from ArrayRef warning (PR #146577)

2025-07-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve getFileIDLocal binary search. (PR #146510)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -855,35 +857,24 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { break; } - NumProbes = 0; - while (true) { -unsigned MiddleIndex = (GreaterIndex-LessIndex)/2+LessIndex; -SourceLocation::UIntTy MidOffset = -getLoc

[clang] [clang] Improve getFileIDLocal binary search. (PR #146510)

2025-07-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm not really a fan of how we're doing this. This should only be caused by a failed lookup. This also seems about 2x as complicated as it needs to be. I like the idea ehre, but not at this level of complexity. @AaronBallman perhaps has a better idea

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -804,6 +807,52 @@ void Sema::DiagnoseUnknownTypeName(IdentifierInfo *&II, assert(SS && SS->isInvalid() && "Invalid scope specifier has already been diagnosed"); } + + // don't note standard include files for OpenCL and Objective C + if ((getLangOpts().CPlu

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -454,6 +459,9 @@ bool Parser::ParseOptionalCXXScopeSpecifier( // We have an identifier followed by a '::'. Lookup this name // as the name in a nested-name-specifier. Token Identifier = Tok; + FullNamespace += Identifier.getIdentifierInfo()->getName();

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -226,6 +226,11 @@ bool Parser::ParseOptionalCXXScopeSpecifier( HasScopeSpecifier = true; } + // If `FailedNestedNameBuilding` is true, attempt to suggest the standard + // include file corresponding to the current `FullNamespace` and symbol. + std::string FullNames

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -3613,6 +3613,16 @@ class Sema final : public SemaBase { ParsedType &SuggestedType, bool IsTemplateName = false); + // Try to suggest the missing standard library include files + // + // \param SymbolName the

[clang] [clang] Improve getFileIDLocal binary search. (PR #146510)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -855,35 +857,24 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { break; } - NumProbes = 0; - while (true) { -unsigned MiddleIndex = (GreaterIndex-LessIndex)/2+LessIndex; -SourceLocation::UIntTy MidOffset = -getLoc

[clang] [clang] Improve getFileIDLocal binary search. (PR #146510)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -855,35 +857,24 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { break; } - NumProbes = 0; - while (true) { -unsigned MiddleIndex = (GreaterIndex-LessIndex)/2+LessIndex; -SourceLocation::UIntTy MidOffset = -getLoc

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -478,6 +478,7 @@ Improvements to Clang's diagnostics diagnostics. This fixes a bunch of `bool` being printed as `_Bool`, and also a bunch of HLSL types being printed as their C++ equivalents. - Clang now consistently quotes expressions in diagnostics. +- Clang now sugges

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -465,6 +473,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier( if (Actions.ActOnCXXNestedNameSpecifier( getCurScope(), IdInfo, EnteringContext, SS, CorrectionFlagPtr, OnlyNamespace)) { +FailedNesatedNameBuilding = true; --

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/146227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -29,6 +29,27 @@ class NamespaceDecl; class DeclContext; namespace tooling { namespace stdlib { +enum Version { erichkeane wrote: We already have enums for standards versions elsewhere, I don't want us maintaining ANOTHER one. So I'm against this enum enti

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -5990,6 +5990,10 @@ def err_template_expansion_into_fixed_list : Error< "template|concept}0">; def note_parameter_type : Note< "parameter of type %0 is declared here">; +def note_standard_lib_include_suggestion : Note< + "maybe try to include %0; '%1' is defined in %0">

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -554,6 +563,11 @@ bool Parser::ParseOptionalCXXScopeSpecifier( break; } + if (FailedNesatedNameBuilding && Tok.getKind() == tok::identifier) { erichkeane wrote: Parser isn't really the right place to do this. This is very much a 'sema' diagnostic/

[clang] [clang][Sema] Suggest/Hint Standard Library Include File (PR #146227)

2025-07-01 Thread Erich Keane via cfe-commits
@@ -5990,6 +5990,10 @@ def err_template_expansion_into_fixed_list : Error< "template|concept}0">; def note_parameter_type : Note< "parameter of type %0 is declared here">; +def note_standard_lib_include_suggestion : Note< + "maybe try to include %0; '%1' is defined in %0">

[clang] [mlir] [OpenACC][CIR] Implement 'rest' of update clause lowering (PR #146414)

2025-07-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/146414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement 'rest' of update clause lowering (PR #146414)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/146414 This implements the async, wait, if, and if_present (as well as device_type, but that is a detail of async/wait) lowering. All of these are implemented the same way they are for the compute constructs,

[clang] [clang] Don't use raw source location in DeclarationName, NFC (PR #146412)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -1669,6 +1669,85 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// GetBitfieldOp +//===--===// + +def GetBitfieldOp : CI

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -1669,6 +1669,85 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// GetBitfieldOp +//===--===// + +def GetBitfieldOp : CI

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -1669,6 +1669,85 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// GetBitfieldOp +//===--===// + +def GetBitfieldOp : CI

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -375,4 +375,67 @@ def CIR_VisibilityAttr : CIR_EnumAttr { }]; } +//===--===// +// BitfieldInfoAttr +//===--===// + +def BitfieldInfoAttr

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/145971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream get_bitfield operation to load bit-field members from structs (PR #145971)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A couple of nits to docs, else this looks fine to me. I think @bcardosolopes should probably approve this though. https://github.com/llvm/llvm-project/pull/145971 ___ cfe-commits mailing list cfe-commits@lists

[clang] [OpenACC][CIR] 'update' construct lowering + a few clauses (PR #146378)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/146378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] 'update' construct lowering + a few clauses (PR #146378)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/146378 >From 87565b6e11a98d7fcab9262a95bb578c4465c6ad Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 30 Jun 2025 08:33:55 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] 'update' construct lowering + a few clauses

[clang] [OpenACC][CIR] 'update' construct lowering + a few clauses (PR #146378)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/146378 The 'update' construct has 3 'var-list' clauses, device, self, and host. Each has a pretty simple data-operand type syntax in the IR, so this patch implements them as well. At least one of those is required

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I did a light pass of the 1st 1/4 of this or so. The smuggling back and > > forth to raw-encoding seems strange? WHy are we doing that here? > > In this patch, to keep AST node size as small as possible, we're using 40 > bits of `StmtBits` to store the SourceLocation, we

[clang] [NFC] Remove getDefaultCallingConvention IsBuiltin (PR #145904)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems reasonable to me, though my knowledge of this is limited (I might be in the blame becasue I did a huge refactor here in the past). @efriedma-quic perhaps has a comment? https://github.com/llvm/llvm-project/pull/145904

[clang] [CIR] Upstream GenericSelectionExpr for ComplexType (PR #146265)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, else this is ok. please make sure the comment gets added, but then feel free to merge. https://github.com/llvm/llvm-project/pull/146234 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/146234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -1979,6 +1979,9 @@ void clang::inferNoReturnAttr(Sema &S, const Decl *D) { if (!FD->hasAttr() && !FD->hasAttr() && isKnownToAlwaysThrow(FD)) { NonConstFD->addAttr(InferredNoReturnAttr::CreateImplicit(S.Context)); + +// Emit a diagnostic suggesting the functio

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -698,8 +703,7 @@ class DeclarationNameLoc { // The location (if any) of the operator keyword is stored elsewhere. struct CXXOpName { -SourceLocation::UIntTy BeginOpNameLoc; -SourceLocation::UIntTy EndOpNameLoc; +CXXOperatorSourceInfo* OInfo;

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -769,17 +774,12 @@ class DeclarationNameLoc { DNL.setNamedTypeLoc(TInfo); return DNL; } - - /// Construct location information for a non-literal C++ operator. - static DeclarationNameLoc makeCXXOperatorNameLoc(SourceLocation BeginLoc, -

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -682,6 +682,11 @@ class DeclarationNameTable { DeclarationName getCXXLiteralOperatorName(const IdentifierInfo *II); }; +struct CXXOperatorSourceInfo { + SourceLocation::UIntTy BeginOpNameLoc; + SourceLocation::UIntTy EndOpNameLoc; erichkeane wrote: Cur

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/146314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -742,8 +742,12 @@ class CXXBoolLiteralExpr : public Expr { SourceLocation getBeginLoc() const { return getLocation(); } SourceLocation getEndLoc() const { return getLocation(); } - SourceLocation getLocation() const { return CXXBoolLiteralExprBits.Loc; } - void setLoc

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I did a light pass of the 1st 1/4 of this or so. The smuggling back and forth to raw-encoding seems strange? WHy are we doing that here? Otherwise just minor questions/requested analysis. FWIW, I'm reasonably comfortable with just pulling this band-ai

[clang] [clang-tools-extra] WIP: Extend SourceLocation to 64 bits. (PR #146314)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -682,6 +682,11 @@ class DeclarationNameTable { DeclarationName getCXXLiteralOperatorName(const IdentifierInfo *II); }; +struct CXXOperatorSourceInfo { + SourceLocation::UIntTy BeginOpNameLoc; erichkeane wrote: I could have sworn I just saw this structur

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-30 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [mlir] [OpenACC][CIR] Implement 'exit data' construct + clauses (PR #146167)

2025-06-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/146167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement 'exit data' construct + clauses (PR #146167)

2025-06-27 Thread Erich Keane via cfe-commits
erichkeane wrote: Sorry for the force-push, screwed up the clang-format commit and rather than spending time backing it out, i hoped no one would be affected. https://github.com/llvm/llvm-project/pull/146167 ___ cfe-commits mailing list cfe-commits@li

[clang] [mlir] [OpenACC][CIR] Implement 'exit data' construct + clauses (PR #146167)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/146167 >From f56e646eb2739d4a254a6e9dcc3042c7d14862ea Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 27 Jun 2025 14:53:15 -0700 Subject: [PATCH] [OpenACC][CIR] Implement 'exit data' construct + clauses Simila

[clang] [mlir] [OpenACC][CIR] Implement 'exit data' construct + clauses (PR #146167)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/146167 Similar to 'enter data', except the data clauses have a 'getdeviceptr' operation before, so that they can properly use the 'exit' operation correctly. While this is a touch awkward, it fits perfectly into t

[clang] [llvm] [LLVM][Clang] Add and enable strict mode for `getTrailingObjects` (PR #144930)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/144930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement enter-data + clause lowering (PR #146146)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/146146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement enter-data + clause lowering (PR #146146)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/146146 >From 27f2b1d2af4fb5f5befd5709c199ae4616d676e2 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 27 Jun 2025 12:06:19 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Implement enter-data + clause lowering 'ente

[clang] [mlir] [OpenACC][CIR] Implement enter-data + clause lowering (PR #146146)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/146146 'enter data' is a new construct type that requires one of the data clauses, so we had to wait for all clauses to be ready before we could commit this. Most of the clauses are simple, but there is a little b

[clang] [mlir] [OpenACC][CIR] Implement enter-data + clause lowering (PR #146146)

2025-06-27 Thread Erich Keane via cfe-commits
erichkeane wrote: Particular attention to @razvanlupusoru due to the ACC dialect changes. https://github.com/llvm/llvm-project/pull/146146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [CIR] Upstream support for operator assign (PR #145979)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall( /*Delegating=*/true, thisAddr, delegateArgs, loc); } +void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) { + const auto *assignOp = cast(curGD.getDe

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -verify %s +// expected-no-diagnostics + +namespace std { + class string { + public: +string(const char*); // constructor for runtime_error + }; + class runtime_error { + publi

[clang] [mlir] [OpenACC][CIR] Implement copyin/copyout/create lowering for compute/c… (PR #145976)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/145976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/145166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/145802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for operator assign (PR #145979)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall( /*Delegating=*/true, thisAddr, delegateArgs, loc); } +void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) { + const auto *assignOp = cast(curGD.getDe

[clang] [CIR] Upstream support for operator assign (PR #145979)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/145979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement copyin/copyout/create lowering for compute/c… (PR #145976)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/145976 >From b1c4ebc8e9efba38f2cda2696f60cc4a86c3fd89 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 26 Jun 2025 09:02:15 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Implement copyin/copyout/create lowering for

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Want 1 more test and a preference on interface, else I'm pretty good here. https://github.com/llvm/llvm-project/pull/145166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -2434,9 +2434,12 @@ Sema::PopFunctionScopeInfo(const AnalysisBasedWarnings::Policy *WP, OpenMP().popOpenMPFunctionRegion(Scope.get()); // Issue any analysis-based warnings. - if (WP && D) + if (WP && D) { +if (auto *FD = dyn_cast(D)) { erichkea

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/145166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for operator assign (PR #145979)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -85,23 +85,24 @@ RValue CIRGenFunction::emitCXXMemberOrOperatorMemberCallExpr( return RValue::get(nullptr); } - bool trivialForCodegen = - md->isTrivial() || (md->isDefaulted() && md->getParent()->isUnion()); - bool trivialAssignment = - trivialForCodegen

[clang] [CIR] Upstream support for operator assign (PR #145979)

2025-06-27 Thread Erich Keane via cfe-commits
@@ -258,6 +258,30 @@ void CIRGenFunction::emitDelegateCXXConstructorCall( /*Delegating=*/true, thisAddr, delegateArgs, loc); } +void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) { + const auto *assignOp = cast(curGD.getDe

[clang] [CIR] Refactor type interfaces (PR #146044)

2025-06-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/146044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [mlir] [OpenACC][CIR] Implement copyin/copyout/create lowering for compute/c… (PR #145976)

2025-06-27 Thread Erich Keane via cfe-commits
erichkeane wrote: All fixed up! I had to make some changes to the dialect, so I'd very much like @razvanlupusoru to confirm/approve. https://github.com/llvm/llvm-project/pull/145976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [OpenACC][Docs] Add a release note for Clang 21 (PR #145938)

2025-06-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/145938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] ms-abi: member pointer inheritance model lock-down fix (PR #145958)

2025-06-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/145958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][Docs] Add a release note for Clang 21 (PR #145938)

2025-06-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/145938 This patch adds a release note that explains the current status of OpenACC in Clang. Currently we cannot actually make an executable because the OpenACC dialect of MLIR doesn't support any amount of lowering

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-26 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > > This is missing test coverage for the interesting cases. > > > > I'm a bit worried about how easy it will be to apply this attribute in > > > > unexpected places. e.g., it will apply to member functions as well as > > > > free functions, will anyone expect that though?

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, // TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed const unsigned sizeTypeSize = astContext.getTypeSize(astContext.getSignedSizeType()); + SizeSizeInBytes = astContext.toCha

[clang] [OpenACC][CIR] Implement 'modifier-list' lowering (PR #145770)

2025-06-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/145770 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -647,7 +647,11 @@ Improvements to Clang's diagnostics #GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490, #GH36703, #GH32903, #GH23312, #GH69874. - +- Improved the performance of static assertions envolving large integers by + using hex format inste

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -647,7 +647,11 @@ Improvements to Clang's diagnostics #GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490, #GH36703, #GH32903, #GH23312, #GH69874. - +- Improved the performance of static assertions envolving large integers by erichkea

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -196,7 +196,7 @@ enum GH59352 { // expected-warning {{enumeration values exceed range of largest BigVal = wb }; _Static_assert(BigVal == wb); /* expected-error {{static assertion failed due to requirement 'BigVal ==

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [clang] Avoid printing overly large integer/_BitInt numbers in static assertion failure diagnostics #71675 (PR #145053)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -17575,7 +17576,21 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, break; } } - V.getInt().toString(Str); + + llvm::APSInt vInt = V.getInt(); + if (llvm::APSInt::compareValues( + vInt, llvm::APSInt::get

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -66,6 +66,16 @@ struct CIRGenTypeCache { unsigned char PointerSizeInBytes; }; + /// The size and alignment of size_t. + union { +unsigned char SizeSizeInBytes; // sizeof(size_t) erichkeane wrote: Is this used? Also, fact that this and the one

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, // TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed const unsigned sizeTypeSize = astContext.getTypeSize(astContext.getSignedSizeType()); + SizeSizeInBytes = astContext.toCha

[clang] [OpenACC][CIR] Implement 'modifier-list' lowering (PR #145770)

2025-06-26 Thread Erich Keane via cfe-commits
@@ -286,16 +286,28 @@ class OpenACCClauseCIREmitter final std::move(bounds)}; } + mlir::acc::DataClauseModifier + convertModifiers(OpenACCModifierKind modifiers) { +using namespace mlir::acc; +DataClauseModifier mlirModifiers{}; + +// The MLIR repre

[clang] [OpenACC][CIR] Implement 'modifier-list' lowering (PR #145770)

2025-06-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/145770 >From 188633e5eed60d0db90cd4256ed0f5b13a369082 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 25 Jun 2025 11:55:50 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Implement 'modifier-list' lowering Some of t

[clang] [llvm] [LLVM][Clang] Add and enable strict mode for `getTrailingObjects` (PR #144930)

2025-06-25 Thread Erich Keane via cfe-commits
erichkeane wrote: > Sure: The first line of the description attempts to define it: > > > Under strict mode, the templated getTrailingObjects can be called only when > > there is > 1 trailing types. > > I essentially used this strict mode to find all templated calls to > `getTrailingObjects` t

[clang] [clang] Revise relnote for int->enum conversion. (PR #145755)

2025-06-25 Thread Erich Keane via cfe-commits
erichkeane wrote: > Backporting fixes to Boost seems like something most people won't want to > mess with. We have a reference to the pull request if anyone wants to dig > into the gory details. Thats fair I guess. https://github.com/llvm/llvm-project/pull/145755 ___

[clang] [Clang] Improve diagnostics for 'placement new' with const storage argument (PR #144270)

2025-06-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm happy once @ojhunt is. https://github.com/llvm/llvm-project/pull/144270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add release note for int->enum conversion change. (PR #144407)

2025-06-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I see you've done this :) (Sorry, going through my WG21 backlog!). It would be neat if we mentioned how to FIX the boost issue/elaborated a bit on summarizing the discussion), but this is fine-as is. https://github.com/llvm/llvm-project/pull/144407 __

[clang] [OpenACC][CIR] Implement 'modifier-list' lowering (PR #145770)

2025-06-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/145770 Some of the 'data' clauses can have a 'modifier-list' which specifies one of a few keywords from a list. This patch adds support for lowering them following #144806. We have to keep a separate enum from MLI

[clang] [clang] Revise relnote for int->enum conversion. (PR #145755)

2025-06-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Definitely better, and probably good enough. I find myself wondering whether we we want to say `it was fixed in Boost 1.81 in commits` to help people know if they want to cherry-pick those. WDYT? https://github.com/llvm/llvm-project/p

[clang] [Analysis] Avoid some warnings about exit from noreturn function (PR #144408)

2025-06-25 Thread Erich Keane via cfe-commits
@@ -399,6 +401,145 @@ static bool isNoexcept(const FunctionDecl *FD) { return false; } +/// Checks if the given variable, which is assumed to be a function pointer, is +/// initialized with a function having 'noreturn' attribute. +static bool isInitializedWithNoReturn(const

  1   2   3   4   5   6   7   8   9   10   >