[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Matt Arsenault via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: One suggestion, if you are going to go about this problem systematically, try to tackle the hardest problems first. For example: Try to make `MultiLevelTemplateArgumentList` const correct. I would like other suggestions as well. https://github.com/llvm/llvm-project/pull/93493

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

2024-05-28 Thread Nicolas van Kempen via cfe-commits
@@ -501,70 +506,72 @@ def main(): # Build up a big regexy filter from all command line arguments. file_name_re = re.compile("|".join(args.files)) +files = {f for f in files if file_name_re.search(f)} -return_code = 0 +returncode = 0 try: -# S

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

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

2024-05-28 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/89490 >From 33485bf2ab3c683897f1381f3f4ab8294bdb0b72 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Sat, 20 Apr 2024 02:58:25 + Subject: [PATCH] [run-clang-tidy.py] Refactor, add progress indicator, add

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

2024-05-28 Thread Nicolas van Kempen via cfe-commits
nicovank wrote: - Minor change to progress indicator to stay aligned. - Go back to printing command line. I'm fine with leaving this as-is. - I think I pruned some changes by accident on rebase, thanks @5chmidti! Restored runtime number and initial message. -- > More graceful shutdown wo

[clang] [clang codegen] Delete unnecessary GEP cleanup code. (PR #90303)

2024-05-28 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/90303 >From 4a3612bcf0e6dd3a68e2b648bb662b4faf154b26 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 26 Apr 2024 16:58:57 -0700 Subject: [PATCH] [clang codegen] Delete unnecessary GEP cleanup code. There'

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang][AArch64][ARM]: Fix Inefficient loads/stores of _BitInt(N) (PR #93495)

2024-05-28 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: How does this interact with #91364? https://github.com/llvm/llvm-project/pull/93495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I think I should post here an example from our codebase that made me think twice about this PR. First, there's a `MultiLevelTemplateArgumentList` (MLTAL for short), which I believe is one of the backbones of our template engine: https://github.com/llvm/llvm-project/blob/42b4be6

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2024-05-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: @MaskRay seems like this target might be too niche to go into LLVM at this time? is it worth considering some bar before accepting such a thing into LLVM, rather than encouraging folks to maintain such a thing in a branch for now? https://github.com/llvm/llvm-project/pull/8784

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/88182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Don't mark variables from other modules as constant if its initializer is not constant (PR #93530)

2024-05-28 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: I think if a variable is GVA_AvailableExternally, and we can't emit a constant, we should just completely skip emitting the definition: there isn't any point to emitting an available_externally definition that doesn't actually contain any information

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Matt Arsenault via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > `const_cast` here is a relatively recent addition, and I checked out with > @erichkeane that the use case (pack expansion) is legit. According to the > approach you're suggesting, the one who wrote this `const_cast` should > instead refactor the MLTAL to use `llvm::MutableArr

[clang] [llvm] [AArch64][SME] Add intrinsics for multi-vector BFCLAMP (PR #93532)

2024-05-28 Thread Amara Emerson via cfe-commits
aemerson wrote: You should just re-open the old PR instead of making a new one, or if the fix is trivial then just re-commit the change without a PR unless you need someone to review it. https://github.com/llvm/llvm-project/pull/93532 ___ cfe-commits

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Erich Keane via cfe-commits
erichkeane wrote: > One suggestion, if you are going to go about this problem systematically, try > to tackle the hardest problems first. > > For example: Try to make `MultiLevelTemplateArgumentList` const correct. I > would like other suggestions as well. Right, yeah. Unfortunately const-co

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

[clang] 5901d40 - [C] Disallow declarations where a statement is required (#92908)

2024-05-28 Thread via cfe-commits
Author: Aaron Ballman Date: 2024-05-28T14:55:18-04:00 New Revision: 5901d4005f015a46185ddc080038c1a3db3fa2c7 URL: https://github.com/llvm/llvm-project/commit/5901d4005f015a46185ddc080038c1a3db3fa2c7 DIFF: https://github.com/llvm/llvm-project/commit/5901d4005f015a46185ddc080038c1a3db3fa2c7.diff

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/92908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-28 Thread via cfe-commits
@@ -1329,6 +1341,100 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name p

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-28 Thread via cfe-commits
@@ -862,6 +862,15 @@ bool Preprocessor::HandleIdentifier(Token &Identifier) { ModuleImportExpectsIdentifier = true; CurLexerCallback = CLK_LexAfterModuleImport; } + + if ((II.isModulesDeclaration() || Identifier.is(tok::kw_module)) && + !InMacroArgs && !DisableM

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-28 Thread via cfe-commits
@@ -1329,6 +1341,100 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name p

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: > @dwblaikie This patch will bring Clang in line with GCC and MSVC: > https://godbolt.org/z/nj715zbsW would the change be ABI incompatible with previous versions of clang? If so, then it'll need to be versioned in Clang's ClangABI handling, so that platforms (like Sony's Play

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-28 Thread via cfe-commits
@@ -239,7 +239,10 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes( auto IsStmtAttr = [](ParsedAttr &Attr) { return Attr.isStmtAttr(); }; bool AllAttrsAreStmtAttrs = llvm::all_of(CXX11Attrs, IsStmtAttr) && llvm::all_of(GN

[clang] [OpenMP] clang/Driver/Options.td - fix typo in fopenmp-force-usm HelpText (PR #93599)

2024-05-28 Thread Tobias Burnus via cfe-commits
https://github.com/tob2 created https://github.com/llvm/llvm-project/pull/93599 This is a follow up to commit fa4780fa6cc36188b84b2a977ac15351c39d45dd and #76571 @jplehr @jhuber6 >From 2d792bc3f3246dde4a8963dfb7503f811c7ab68f Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Tue, 28 May 2024

[clang] [OpenMP] clang/Driver/Options.td - fix typo in fopenmp-force-usm HelpText (PR #93599)

2024-05-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tobias Burnus (tob2) Changes This is a follow up to commit fa4780fa6cc36188b84b2a977ac15351c39d45dd and #76571 @jplehr @jhuber6 --- Full diff: https://github.com/llvm/llvm-project/pull/93599.diff 1 Files Affected: - (modified) clang/i

[clang] [OpenMP] clang/Driver/Options.td - fix typo in fopenmp-force-usm HelpText (PR #93599)

2024-05-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/93599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-28 Thread William Junda Huang via cfe-commits
huangjd wrote: Could I have a follow up on this? @dwblaikie https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Set up executor implicitly to account for init PTUs (PR #84758)

2024-05-28 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: vgvassilev wrote: I am not sure how this patch changed these tests to start failing on Windows. Do you have any clue? https://github.com/llvm/llvm-project/pull/84758

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Artem Yurchenko via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s + +// CHECK: extern "C" int printf(const char *, ...); +extern "C" int printf(const char *...); + +// CHECK: extern "C++" { temyurchenko wrote: > Oofda, there are differences between the brace

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Artem Yurchenko via cfe-commits
https://github.com/temyurchenko edited https://github.com/llvm/llvm-project/pull/93131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #91384)

2024-05-28 Thread Kai Nacke via cfe-commits
@@ -529,9 +530,379 @@ bool SystemZTargetCodeGenInfo::isVectorTypeBased(const Type *Ty, return false; } +//===--===// +// z/OS XPLINK ABI Implementation +//===

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! The changes should also come with a release note in clang/docs/ReleaseNotes.rst so users know about the change. https://github.com/llvm/llvm-project/pull/80801 ___ cfe-commits mailing list

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/80801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else

[clang] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/93601 Currently we: - emit the elements of the `used` and `compiler.used` arrays as default pointers - assume that the payloads for global ctors/dtors reside in the default AS, and thus use a default pointer to access

[clang] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes Currently we: - emit the elements of the `used` and `compiler.used` arrays as default pointers - assume that the payloads for global ctors/dtors reside in the default AS, and thus use a default pointer to acce

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > `const_cast` here is a relatively recent addition, and I checked out with > > @erichkeane that the use case (pack expansion) is legit. According to the > > approach you're suggesting, the one who wrote this `const_cast` should > > instead refactor the MLTAL to use `llvm::Mut

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/93601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH] Fix `emitUsed` to place `used` globals in the Global AS. Update tes

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff a487616cbf542826d0ba1e7d0dabedca33a27de8 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 --

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Shafik Yaghmour via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Matt Arsenault via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }.

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Matt Arsenault via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [llvm] [EntryExitInstrumenter] Move passes out of clang into LLVM default pipelines (PR #92171)

2024-05-28 Thread Arthur Eubanks via cfe-commits
@@ -1030,6 +1036,12 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, Phase != ThinOrFullLTOPhase::ThinLTOPostLink) MPM.addPass(SampleProfileProbePass(TM)); + // Instrument function entry and exit before all inlining. + if (!isLTOPostLink(

[clang] [clang codegen] Delete unnecessary GEP cleanup code. (PR #90303)

2024-05-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. https://github.com/llvm/llvm-project/pull/90303 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/2] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Yaxun Liu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Matt Arsenault via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }. + /

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Matheus Izvekov via cfe-commits
@@ -1086,45 +1106,100 @@ void TextNodeDumper::VisitNullTemplateArgument(const TemplateArgument &) { void TextNodeDumper::VisitTypeTemplateArgument(const TemplateArgument &TA) { OS << " type"; - dumpType(TA.getAsType()); + dumpTemplateArgument(TA); } void TextNodeDumpe

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-28 Thread Richard Smith via cfe-commits
@@ -152,16 +151,17 @@ LLVM_READONLY inline bool isHexDigit(unsigned char c) { /// Note that '_' is both a punctuation character and an identifier character! LLVM_READONLY inline bool isPunctuation(unsigned char c) { using namespace charinfo; - return (InfoTable[c] & (CHAR_UN

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/93601 >From 34b9646a38c6bdd0419dd9d2eb1bc847c4d16596 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 28 May 2024 20:09:15 +0100 Subject: [PATCH 1/3] Fix `emitUsed` to place `used` globals in the Global AS. Update

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Matheus Izvekov via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument &TA) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-28 Thread via cfe-commits
@@ -152,16 +151,17 @@ LLVM_READONLY inline bool isHexDigit(unsigned char c) { /// Note that '_' is both a punctuation character and an identifier character! LLVM_READONLY inline bool isPunctuation(unsigned char c) { using namespace charinfo; - return (InfoTable[c] & (CHAR_UN

[clang] [llvm] [EntryExitInstrumenter] Move passes out of clang into LLVM default pipelines (PR #92171)

2024-05-28 Thread Arthur Eubanks via cfe-commits
@@ -1030,6 +1036,12 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, Phase != ThinOrFullLTOPhase::ThinLTOPostLink) MPM.addPass(SampleProfileProbePass(TM)); + // Instrument function entry and exit before all inlining. + if (!isLTOPostLink(

[clang] [Clang][NFC] remove CHAR_PUNCT duplication introduced by #93216 (PR #93605)

2024-05-28 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/93605 None >From ac1d7edcca20a0eebf884ca770c72b39a90f9889 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 28 May 2024 21:57:06 +0200 Subject: [PATCH] [Clang][NFC] remove CHAR_PUNCT duplication introduced by

[clang] [Clang][NFC] remove CHAR_PUNCT duplication introduced by #93216 (PR #93605)

2024-05-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/93605.diff 1 Files Affected: - (modified) clang/include/clang/Basic/CharInfo.h (+1-2) ``diff diff --git a/clang/include/clang/Basic/CharInf

[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -387,6 +387,11 @@ Changes in existing checks ` check to properly emit warnings for static data member with an in-class initializer. +- Improved :doc:`readability-redundant-member-init + ` check to avoid + false-positives when type of the member does not match type of

[clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-28 Thread Daniel Thornburgh via cfe-commits
mysterymath wrote: I did some brief investigation on our end. The pkg-config file for libedit includes a private dependency on libncurses, which provides the terminfo functions. The issue here seems to be one uncovered in LLVM's FindLibEdit.cmake. We're building against a static libedit, but t

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] c96860a - [clang-tidy] Optimize realpath in readability-identifier-naming (#92659)

2024-05-28 Thread via cfe-commits
Author: Piotr Zegar Date: 2024-05-28T22:09:34+02:00 New Revision: c96860aea2c77392bad16f1c4f55014164669de3 URL: https://github.com/llvm/llvm-project/commit/c96860aea2c77392bad16f1c4f55014164669de3 DIFF: https://github.com/llvm/llvm-project/commit/c96860aea2c77392bad16f1c4f55014164669de3.diff L

[clang-tools-extra] [clang-tidy] Optimize realpath in readability-identifier-naming (PR #92659)

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

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-28 Thread Alex Voicu via cfe-commits
@@ -2047,9 +2047,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { llvm::Type *CtorPFTy = llvm::PointerType::get(CtorFTy, TheModule.getDataLayout().getProgramAddressSpace()); - // Get the type of a ctor entry, { i32, void ()*, i8* }.

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Artem Yurchenko via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s + +// CHECK: extern "C" int printf(const char *, ...); +extern "C" int printf(const char *...); + +// CHECK: extern "C++" { temyurchenko wrote: > ideally, we want to reproduce exactly what was

[clang-tools-extra] 0aacef3 - [clang-tidy][NFC] Update identifier-length.rst (#93467)

2024-05-28 Thread via cfe-commits
Author: Mattan Elkaim Date: 2024-05-28T22:19:01+02:00 New Revision: 0aacef3abc41cfc8efb5f1b9483bc37599352a59 URL: https://github.com/llvm/llvm-project/commit/0aacef3abc41cfc8efb5f1b9483bc37599352a59 DIFF: https://github.com/llvm/llvm-project/commit/0aacef3abc41cfc8efb5f1b9483bc37599352a59.diff

[clang-tools-extra] Update identifier-length.rst (PR #93467)

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

[clang-tools-extra] Update identifier-length.rst (PR #93467)

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

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Vlad Serebrennikov via cfe-commits
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types + /// AND the ParsedAttr. + template + static std::enable_if_t, SourceLocation> + getAttrLoc(const AttrInfo &AL)

[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/93217 >From 14e3f91ba749eec5be94a9cad370f794ad836fc8 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 22 May 2024 20:56:00 + Subject: [PATCH 1/2] [clang-tidy] Fix handling of members in readability-redundant

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > The problem here is the loss of the qualification on the TemplateNames > > This patch fixes the problem, without taking any workarounds: #93433 > > It also doesn't cause any change in diagnostics in > > `clang/test/SemaTemplate/typename-specifier-3.cpp`. > > I think we shoul

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-28 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Clang only uses `Sema::isLayoutCompatible` in two places: to implement `__is_layout_compatible` and [Clang type safety checking attributes](https://clang.llvm.org/docs/AttributeReference.html#type-safety-checking), which warn if a pointer does not point to a layout compatible

[clang] [clang][AST] fix ast-print of `extern ` with >=2 declarators (PR #93131)

2024-05-28 Thread Artem Yurchenko via cfe-commits
https://github.com/temyurchenko edited https://github.com/llvm/llvm-project/pull/93131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][cmake] Fixes for PGO builds when invoking ninja twice (PR #92591)

2024-05-28 Thread Tom Stellard via cfe-commits
tstellar wrote: Ping. https://github.com/llvm/llvm-project/pull/92591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/93431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument &TA) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM (we should find better delimiters but it is out of scope for this change) https://github.com/llvm/llvm-project/pull/93431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread via cfe-commits
@@ -1086,45 +1106,100 @@ void TextNodeDumper::VisitNullTemplateArgument(const TemplateArgument &) { void TextNodeDumper::VisitTypeTemplateArgument(const TemplateArgument &TA) { OS << " type"; - dumpType(TA.getAsType()); + dumpTemplateArgument(TA); } void TextNodeDumpe

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-05-28 Thread David Stone via cfe-commits
@@ -817,11 +817,11 @@ class alignas(8) Decl { "owned local decl but no local module storage"); return reinterpret_cast(this)[-1]; } - void setLocalOwningModule(Module *M) { + void setLocalOwningModule(const Module *M) { davidstone wrote: Hmm

[clang] 193e900 - [OpenACC][NFC] Fix begin loc and split it from the directive location

2024-05-28 Thread via cfe-commits
Author: erichkeane Date: 2024-05-28T13:39:40-07:00 New Revision: 193e9007ef0bef6c881ab26746221f22ec674447 URL: https://github.com/llvm/llvm-project/commit/193e9007ef0bef6c881ab26746221f22ec674447 DIFF: https://github.com/llvm/llvm-project/commit/193e9007ef0bef6c881ab26746221f22ec674447.diff LO

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Shafik Yaghmour via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument &TA) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Should we also be updating JSONNodeDumper.cpp at the same time? We would ideally update it as well. Not necessarily in the same PR, as it's a separate change that doesn't need to be synchronized. It's just not important to me, because I don't personally use the JSON dumper

[clang] [clang][OpenMP] Simplify check for repeated clauses (PR #93611)

2024-05-28 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/93611 The `FirstClauses` is a vector of pointer-bool pairs, and the pointer part of the pair is never used. Replace the vector with std::bitset, and rename it to `SeenClauses` to make the purpose of it a bit clearer.

[clang] [llvm] [inline] Clone return range attribute on the callsite into inlined call (PR #92666)

2024-05-28 Thread Andreas Jonson via cfe-commits
https://github.com/andjo403 updated https://github.com/llvm/llvm-project/pull/92666 >From 1bc922a6797555b0bf69b187224ba054978fb7ad Mon Sep 17 00:00:00 2001 From: Andreas Jonson Date: Sat, 18 May 2024 19:42:03 +0200 Subject: [PATCH 1/2] [inline] Tests for clone return range attribute on the cal

[clang] 6a47315 - [clang-repl] Even more tests create the Interpreter and must check host JIT support (#84758)

2024-05-28 Thread Stefan Gränitz via cfe-commits
Author: Stefan Gränitz Date: 2024-05-28T22:48:55+02:00 New Revision: 6a47315a3cb2c6d381809f0ba5c89bd8dcdbcaa0 URL: https://github.com/llvm/llvm-project/commit/6a47315a3cb2c6d381809f0ba5c89bd8dcdbcaa0 DIFF: https://github.com/llvm/llvm-project/commit/6a47315a3cb2c6d381809f0ba5c89bd8dcdbcaa0.diff

[clang] [clang][OpenMP] Simplify check for repeated clauses (PR #93611)

2024-05-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krzysztof Parzyszek (kparzysz) Changes The `FirstClauses` is a vector of pointer-bool pairs, and the pointer part of the pair is never used. Replace the vector with std::bitset, and rename it to `SeenClauses` to make the purpose of it a b

[clang] [llvm] [inline] Clone return range attribute on the callsite into inlined call (PR #92666)

2024-05-28 Thread Andreas Jonson via cfe-commits
@@ -1444,6 +1445,8 @@ static AttrBuilder IdentifyValidPoisonGeneratingAttributes(CallBase &CB) { Valid.addAttribute(Attribute::NonNull); if (CB.hasRetAttr(Attribute::Alignment)) Valid.addAlignmentAttr(CB.getRetAlign()); + if (CB.hasRetAttr(Attribute::Range)) +Va

[clang] [llvm] [inline] Clone return range attribute on the callsite into inlined call (PR #92666)

2024-05-28 Thread Andreas Jonson via cfe-commits
andjo403 wrote: Comment fixed and need help with merging. https://github.com/llvm/llvm-project/pull/92666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Simplify check for repeated clauses (PR #93611)

2024-05-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 88902147c11f8de5cc7c792fd8c476a821664297 15c12783f7fcec360eb14a5b857494bc3c75b889 --

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-28 Thread Helena Kotas via cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

<    1   2   3   4   5   >