[clang] [CIR] Change default assumption about allowing builtins (PR #144004)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Seems like a reasonable assumption for now. THOUGH, I wonder if we'd be better off at one point instead to figure out which ones we DO know how to handle, and use the 'nobuiltin' as a fallback instead? That way we can exercise the bui

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { return emitAutoVarDecl(d); } +static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) { + if (cgm.getLangOpts().CPlusPlus) +return cgm.getMangledName(&d).str(); + + // If this

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -208,8 +208,25 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { if (d.hasExternalStorage()) return; - if (d.getStorageDuration() != SD_Automatic) -cgm.errorNYI(d.getSourceRange(), "emitVarDecl automatic storage duration"); + if (d.getStorageDuration() !=

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { return emitAutoVarDecl(d); } +static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) { + if (cgm.getLangOpts().CPlusPlus) +return cgm.getMangledName(&d).str(); + + // If this

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { return emitAutoVarDecl(d); } +static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) { + if (cgm.getLangOpts().CPlusPlus) +return cgm.getMangledName(&d).str(); + + // If this

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -219,6 +236,252 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { return emitAutoVarDecl(d); } +static std::string getStaticDeclName(CIRGenModule &cgm, const VarDecl &d) { + if (cgm.getLangOpts().CPlusPlus) +return cgm.getMangledName(&d).str(); + + // If this

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -185,11 +185,23 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { global.getSymName()); } + mlir::Value createGetGlobal(cir::GlobalOp global) { +return createGetGlobal(global.getLoc(), global); + } + cir::StoreOp createStore

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Minor suggestions, else LGTM. https://github.com/llvm/llvm-project/pull/143980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Support for static variables (PR #143980)

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

[clang] [CIR] Support for static variables (PR #143980)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -208,8 +208,25 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { if (d.hasExternalStorage()) return; - if (d.getStorageDuration() != SD_Automatic) -cgm.errorNYI(d.getSourceRange(), "emitVarDecl automatic storage duration"); + if (d.getStorageDuration() !=

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -1981,8 +1983,16 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) { Trait = StdNameToTypeTrait(Name); if (!Trait) return std::nullopt; -for (const auto &Arg : VD->getTemplateArgs().asArray()) - Args.push_back(Arg.getAsTyp

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -1981,8 +1983,16 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) { Trait = StdNameToTypeTrait(Name); if (!Trait) return std::nullopt; -for (const auto &Arg : VD->getTemplateArgs().asArray()) - Args.push_back(Arg.getAsTyp

[clang] [CIR] Add support for delegating constructors (PR #143932)

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

[clang] [CIR] Add support for delegating constructors (PR #143932)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -267,23 +267,60 @@ class AggValueSlot { Address addr; clang::Qualifiers quals; + /// This is set to true if some external code is responsible for setting up a + /// destructor for the slot. Otherwise the code which constructs it should + /// push the appropriate cle

[clang] [CIR] Add support for delegating constructors (PR #143932)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. bitfields are specified problematically, else lgtm. https://github.com/llvm/llvm-project/pull/143932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -2253,6 +2260,53 @@ static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef, } } +static void DiagnoseNonConstructibleReason( +Sema &SemaRef, SourceLocation Loc, +const llvm::SmallVector &Ts) { + for (const auto &ArgTy : Ts) { +if (ArgTy->isVoidType())

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -2253,6 +2260,53 @@ static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef, } } +static void DiagnoseNonConstructibleReason( +Sema &SemaRef, SourceLocation Loc, +const llvm::SmallVector &Ts) { + for (const auto &ArgTy : Ts) { erichkeane wr

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -1981,8 +1982,14 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) { Trait = StdNameToTypeTrait(Name); if (!Trait) return std::nullopt; -for (const auto &Arg : VD->getTemplateArgs().asArray()) - Args.push_back(Arg.getAsTyp

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -1981,8 +1982,14 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) { Trait = StdNameToTypeTrait(Name); if (!Trait) return std::nullopt; -for (const auto &Arg : VD->getTemplateArgs().asArray()) - Args.push_back(Arg.getAsTyp

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Few comments, but generally looks good to me. https://github.com/llvm/llvm-project/pull/143309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

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

[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -1981,8 +1982,14 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) { Trait = StdNameToTypeTrait(Name); if (!Trait) return std::nullopt; -for (const auto &Arg : VD->getTemplateArgs().asArray()) - Args.push_back(Arg.getAsTyp

[clang] [clang][Preprocessor] Add peekNextPPToken, makes look ahead next token without side-effects (PR #143898)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I find myself wondering based on the patch: DO we actually care about the token itself, or just the kind? Could we instead have `peekNextPPToken` instead be `peekNextPPTokenKind` and just return the next token kind? That way we don't need the optional,

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -4503,7 +4510,7 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, } else { const Expr *Base = LVal.Base.dyn_cast(); -if (!Frame) { +if (AK != clang::AK_ReferenceInitialization && !Frame) { erichkeane wrote: Can we mo

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 2 comments. Else, I'm not really the best one to review th is part of the code, but everything looks appropriate. https://github.com/llvm/llvm-project/pull/143667 ___ cfe-commits mailing list cfe-commits@lists

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

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

[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-06-12 Thread Erich Keane via cfe-commits
@@ -4418,6 +4420,9 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, return CompleteObject(); } +// if(AK == clang::AK_ReferenceInitialization) erichkeane wrote: This is commented out? https://github.com/llvm/llvm-proj

[clang] [clang] increase default constexpr step limit (PR #143785)

2025-06-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Typically we set limits like this for at least somewhat of a reasoned-reason. Can we do some archeology to figure out when/why we decided on this limit? Many times these limits are a result of our own stack space limits, so it would be interesting to

[clang] Add missing intrinsics to cuda headers (PR #143664)

2025-06-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > Erich, is there a good point-of-contact at nvidia who can review CUDA > intrinsic header changes in the future? For the most part, we don't have ANYTHING to do with CUDA in clang as far as I know. I also don't know much about CUDA, but I'll ping an internal slack channel

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

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

[clang] [mlir] [OpenACC][CIR] Add parallelism determ. to all acc.loops (PR #143751)

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

[clang] [OpenACC][CIR] Add parallelism determ. to all acc.loops (PR #143751)

2025-06-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/143751 PR #143720 adds a requirement to the ACC dialect that every acc.loop must have a seq, independent, or auto attribute for the 'default' device_type. The standard has rules for how this can be intuited: orpha

[clang] [mlir] [OpenACC][CIR] Add parallelism determ. to all acc.loops (PR #143751)

2025-06-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/143751 >From 644612d088f28a21f7f59496de00f8c14de89c1d Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 11 Jun 2025 09:54:46 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Add parallelism determ. to all acc.loops PR

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -21,6 +21,88 @@ using namespace clang; using namespace clang::CIRGen; +/// Checks whether the given constructor is a valid subject for the +/// complete-to-base constructor delgation optimization, i.e. emitting the erichkeane wrote: ```suggestion /// compl

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -21,6 +21,88 @@ using namespace clang; using namespace clang::CIRGen; +/// Checks whether the given constructor is a valid subject for the +/// complete-to-base constructor delgation optimization, i.e. emitting the +/// complete constructor as a simple call to the base cons

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

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

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -37,6 +37,10 @@ class CIRGenCXXABI { void setCXXABIThisValue(CIRGenFunction &cgf, mlir::Value thisPtr); + /// Emit a single constructor/destructor with the gien type from a C++ erichkeane wrote: ```suggestion /// Emit a single constructor/destructor

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -72,6 +82,72 @@ void CIRGenItaniumCXXABI::emitInstanceFunctionProlog(SourceLocation loc, } } +void CIRGenItaniumCXXABI::addImplicitStructorParams(CIRGenFunction &cgf, +QualType &retTY, +

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -55,12 +59,29 @@ class CIRGenCXXABI { return md->getParent(); } + /// Return whether the given global decl needs a VTT parameter. erichkeane wrote: can we say what a VTT parameter is? https://github.com/llvm/llvm-project/pull/143639 ___

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
@@ -37,6 +37,10 @@ class CIRGenCXXABI { void setCXXABIThisValue(CIRGenFunction &cgf, mlir::Value thisPtr); + /// Emit a single constructor/destructor with the gien type from a C++ + /// constructor Decl. erichkeane wrote: ```suggestion /// constructor/

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. A few nits, but happy once the others are. https://github.com/llvm/llvm-project/pull/143639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [Clang] _default-movable_ should be based on the first declaration (PR #143661)

2025-06-11 Thread Erich Keane via cfe-commits
erichkeane wrote: I'm disturbed at how much of these fixes are ending up being `getCanonicalDecl` sprinkled around. IMO we need to start being better about making the functions we use to 'check' things auto-canonicalizing. https://github.com/llvm/llvm-project/pull/143661 _

[clang] [Clang] _default-movable_ should be based on the first declaration (PR #143661)

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

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -63,3 +66,74 @@ Address CIRGenFunction::getAddressOfBaseClass( return value; } + +void CIRGenFunction::emitCXXConstructorCall(const clang::CXXConstructorDecl *d, +clang::CXXCtorType type, +

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -141,6 +190,44 @@ arrangeFreeFunctionLikeCall(CIRGenTypes &cgt, CIRGenModule &cgm, return cgt.arrangeCIRFunctionInfo(retType, argTypes, required); } +/// Arrange a call to a C++ method, passing the given arguments. +/// +/// passProtoArgs indicates whether `args` has arg

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -76,6 +83,48 @@ static void appendParameterTypes(const CIRGenTypes &cgt, cgt.getCGModule().errorNYI("appendParameterTypes: hasExtParameterInfos"); } +const CIRGenFunctionInfo & +CIRGenTypes::arrangeCXXStructorDeclaration(GlobalDecl gd) { + auto *md = cast(gd.getDecl());

[clang] fix access checking about function overloading (PR #107768)

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

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -63,3 +66,74 @@ Address CIRGenFunction::getAddressOfBaseClass( return value; } + +void CIRGenFunction::emitCXXConstructorCall(const clang::CXXConstructorDecl *d, +clang::CXXCtorType type, +

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -141,6 +190,44 @@ arrangeFreeFunctionLikeCall(CIRGenTypes &cgt, CIRGenModule &cgm, return cgt.arrangeCIRFunctionInfo(retType, argTypes, required); } +/// Arrange a call to a C++ method, passing the given arguments. +/// +/// passProtoArgs indicates whether `args` has arg

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -63,3 +66,74 @@ Address CIRGenFunction::getAddressOfBaseClass( return value; } + +void CIRGenFunction::emitCXXConstructorCall(const clang::CXXConstructorDecl *d, +clang::CXXCtorType type, +

[clang] [CIR] Upstream support for calling constructors (PR #143579)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -76,6 +83,48 @@ static void appendParameterTypes(const CIRGenTypes &cgt, cgt.getCGModule().errorNYI("appendParameterTypes: hasExtParameterInfos"); } +const CIRGenFunctionInfo & +CIRGenTypes::arrangeCXXStructorDeclaration(GlobalDecl gd) { + auto *md = cast(gd.getDecl());

[clang] [-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (PR #143487)

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

[clang] [-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (PR #143487)

2025-06-10 Thread Erich Keane via cfe-commits
@@ -260,6 +260,11 @@ static void CheckStringInit(Expr *Str, QualType &DeclT, const ArrayType *AT, diag::ext_initializer_string_for_char_array_too_long) << Str->getSourceRange(); else if (StrLength - 1 == ArrayLen) { + // If the string literal is

[clang] [-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (PR #143487)

2025-06-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Please add tests for other encodings. Also, needs a release note. https://github.com/llvm/llvm-project/pull/143487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] Remove delayed typo expressions (PR #143423)

2025-06-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I spent a while with these changes, and they all seem correct to me best I can tell. As most seems to just be deletions, its as good as I can figure. It would be cool if we could have done this more gradually, but I'm happy to commit-a

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -201,6 +201,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fcla

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,55 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -229,6 +230,36 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -229,6 +230,36 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -38,3 +38,25 @@ mlir::Value CIRGenBuilderTy::getArrayElement(mlir::Location arrayLocBegin, const mlir::Type flatPtrTy = basePtr.getType(); return create(arrayLocEnd, flatPtrTy, basePtr, idx); } + +cir::ConstantOp CIRGenBuilderTy::getConstInt(mlir::Location loc, +

[clang] [Clang] Clarify the `[[trivial_abi]]` documentation. (PR #143243)

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

[clang] [Clang] Clarify the `[[trivial_abi]]` documentation. (PR #143243)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -4431,7 +4431,11 @@ destroy the object before returning. The lifetime of the copy of the parameter in the caller ends without a destructor call when the call begins. If a type is trivial for the purpose of calls, it is assumed to be trivially -relocatable for the purpose o

[clang] [Clang] Clarify the `[[trivial_abi]]` documentation. (PR #143243)

2025-06-09 Thread Erich Keane via cfe-commits
@@ -4431,7 +4431,11 @@ destroy the object before returning. The lifetime of the copy of the parameter in the caller ends without a destructor call when the call begins. If a type is trivial for the purpose of calls, it is assumed to be trivially -relocatable for the purpose o

[clang] [Clang] Explain why a type is not replaceable. (PR #143265)

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

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

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

[clang] [CIR] Add support for using enum constants (PR #143214)

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

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -1677,6 +1678,34 @@ bool CIRGenModule::verifyModule() const { return mlir::verify(theModule).succeeded(); } +// TODO(cir): this can be shared with LLVM codegen. +CharUnits CIRGenModule::computeNonVirtualBaseClassOffset( +const CXXRecordDecl *derivedClass, CastExpr::pa

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -1677,6 +1678,34 @@ bool CIRGenModule::verifyModule() const { return mlir::verify(theModule).succeeded(); } +// TODO(cir): this can be shared with LLVM codegen. +CharUnits CIRGenModule::computeNonVirtualBaseClassOffset( +const CXXRecordDecl *derivedClass, CastExpr::pa

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,69 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

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

[clang] [flang] [llvm] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Once this passes CI/goes green check, I think we're good to click the 'merge' button. https://github.com/llvm/llvm-project/pull/142800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [OpenACC][CIR] Implement 'host_data' lowering, plus all clauses (PR #143136)

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

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Erich Keane via cfe-commits
erichkeane wrote: > It looks like we have a number of approvals and I haven't seen any objections > yet. > > Should we go ahead with merging this in the current state? If so, I'll need > help there since I don't have commit access yet. @tarunprabhu would you mind > volunteering to mash the me

[clang] [CIR] Add support for completing forward-declared types (PR #143176)

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

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, options::OPT_fno_loop_interchange, EnableInterchange)) CmdArgs.push_back("-floop-interchange"); } + +std::optional tools::ParseMPreferVectorWidthOption( +clang::Diagno

[clang] [NFC][Clang] Adopt simplified `getTrailingObjects` in ExprCXX (PR #143125)

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

[clang] [OpenACC][CIR] Implement 'host_data' lowering, plus all clauses (PR #143136)

2025-06-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/143136 'host_data' has its own Op kind, so this handles the lowering there, it looks exactly like the other ones we've done so far, so nothing novel here. host_data takes 3 clauses, 1 of which is required. 'use_de

[clang] [clang] Check constexpr int->enum conversions consistently. (PR #143034)

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

[clang] [clang] Diagnose [[nodiscard]] return types in Objective-C++ (PR #142541)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -272,6 +273,26 @@ QualType ObjCMessageExpr::getCallReturnType(ASTContext &Ctx) const { return Ctx.getReferenceQualifiedType(this); } +std::pair +ObjCMessageExpr::getUnusedResultAttr(ASTContext &Ctx) const { + // If the callee is marked nodiscard, return that attribute +

[clang] [clang] Diagnose [[nodiscard]] return types in Objective-C++ (PR #142541)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -272,6 +273,26 @@ QualType ObjCMessageExpr::getCallReturnType(ASTContext &Ctx) const { return Ctx.getReferenceQualifiedType(this); } +std::pair erichkeane wrote: I think we're decades past 'maybe we'll support other kinds some day' :D If you're willi

[clang] [OpenACC][CIR] Implement member exprs for 'copy' lowering (PR #142998)

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

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-06-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this is a strict improvement, and I think looks correct to me. https://github.com/llvm/llvm-project/pull/141305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-06-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,35 @@ +#ifndef LLVM_CLANG_BASIC_ATTRIBUTESCOPEINFO_H erichkeane wrote: This needs a file header. https://github.com/llvm/llvm-project/pull/141305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

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

[clang] [OpenACC][CIR] Implement member exprs for 'copy' lowering (PR #142998)

2025-06-05 Thread Erich Keane via cfe-commits
erichkeane wrote: > Nice job with the testing! I had a moment of panic seeing the size of this > change, only to find that it's mostly test cases. I have a couple of > questions, but it looks good. Honestly you're not wrong :) I wrote all of these tests in advance expecting this to be 6-7 di

[clang] [OpenACC][CIR] Implement member exprs for 'copy' lowering (PR #142998)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -754,12 +754,320 @@ void acc_compute(int parmVar) { // CHECK-NEXT: %[[ZERO_CONST:.*]] = arith.constant 0 : i64 // CHECK-NEXT: %[[ONE_CONST2:.*]] = arith.constant 1 : i64 // CHECK-NEXT: %[[BOUNDS3:.*]] = acc.bounds lowerbound(%[[ONE_CAST]] : si32) extent(%[[ONE_CAST2]]

[clang] [OpenACC][CIR] Implement member exprs for 'copy' lowering (PR #142998)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -754,12 +754,320 @@ void acc_compute(int parmVar) { // CHECK-NEXT: %[[ZERO_CONST:.*]] = arith.constant 0 : i64 // CHECK-NEXT: %[[ONE_CONST2:.*]] = arith.constant 1 : i64 // CHECK-NEXT: %[[BOUNDS3:.*]] = acc.bounds lowerbound(%[[ONE_CAST]] : si32) extent(%[[ONE_CAST2]]

[clang] [OpenACC][CIR] Implement member exprs for 'copy' lowering (PR #142998)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -226,6 +228,10 @@ class OpenACCClauseCIREmitter final mlir::Location exprLoc = cgf.cgm.getLoc(curVarExpr->getBeginLoc()); llvm::SmallVector bounds; +std::string exprString; +llvm::raw_string_ostream os(exprString); +e->printPretty(os, nullptr, cgf.getCon

[clang] [CIR] Add empty handlers for Using and UsingShadow decls (PR #143032)

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

[clang] [CIR] Add decl case for template specialization (PR #143029)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -0,0 +1,88 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

[clang] [CIR] Add decl case for template specialization (PR #143029)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -0,0 +1,88 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

[clang] [CIR] Add decl case for template specialization (PR #143029)

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

[clang] [CIR] Add decl case for template specialization (PR #143029)

2025-06-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 2 nits, else lgtm. https://github.com/llvm/llvm-project/pull/143029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// LLVMIntrinsicCallOp +//===--===// + +def LLVM

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -44,16 +44,25 @@ class CIRGenCalleeInfo { class CIRGenCallee { enum class SpecialKind : uintptr_t { Invalid, +Builtin, erichkeane wrote: Line 49 needs to be updated for this. https://github.com/llvm/llvm-project/pull/142981 __

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -201,6 +201,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -1004,8 +1004,48 @@ static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { return cgm.getAddrOfFunction(gd); } -static CIRGenCallee emitDirectCallee(CIRGenModule &cgm, GlobalDecl gd) { - assert(!cir::MissingFeatures::opCallBuiltinFunc()); +// Det

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-05 Thread Erich Keane via cfe-commits
@@ -47,6 +47,10 @@ class CIRGenFunction : public CIRGenTypeCache { /// is where the next operations will be introduced. CIRGenBuilderTy &builder; + /// Largest vector width used in ths function. Will be used to create a erichkeane wrote: ```suggestion

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

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

  1   2   3   4   5   6   7   8   9   10   >