[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > It can also happen in user defined class. Yes. But it's unclear what the behavior of the check should be. For `std::array`, it's clear, because one must not touch the internal element. For a user-defined type, "it depends" on how the user wants to design their struct.

[clang] Reland [clang] Handle instantiated members to determine visibility (#136128) (PR #136689)

2025-04-28 Thread Andrew Savonichev via cfe-commits
https://github.com/asavonic closed https://github.com/llvm/llvm-project/pull/136689 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: @RiverDave Do you have permissions to land the PR, or shall I do it for you? https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] 60b3a5b - [clang][bytecode] Fix two small builtin_constant_p cases (#137587)

2025-04-28 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-28T09:21:49+02:00 New Revision: 60b3a5b7e7db40ec74d3c4839a3fae8b73d98851 URL: https://github.com/llvm/llvm-project/commit/60b3a5b7e7db40ec74d3c4839a3fae8b73d98851 DIFF: https://github.com/llvm/llvm-project/commit/60b3a5b7e7db40ec74d3c4839a3fae8b73d98851.diff L

[clang] [clang][bytecode] Fix two small builtin_constant_p cases (PR #137587)

2025-04-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/137587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix two small builtin_constant_p cases (PR #137587)

2025-04-28 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `clang` at step 6 "test-openmp". Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/4271 Here is the relevant pie

[clang] [clang-format] Fix a bug in annotating TT_PointerOrReference (PR #136073)

2025-04-28 Thread kadir çetinkaya via cfe-commits
kadircet wrote: this didn't seem to restore the desired formatting, re-openning #135972 with additional context https://github.com/llvm/llvm-project/pull/136073 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang][driver] Suppress gnu-line-marker when saving temps (PR #134621)

2025-04-28 Thread via cfe-commits
macurtis-amd wrote: @MaskRay ping https://github.com/llvm/llvm-project/pull/134621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread via cfe-commits
@@ -130,6 +133,20 @@ static bool saveMLIRTempFile(const CompilerInvocation &ci, // Custom BeginSourceFileAction //===--===// + +static llvm::cl::opt ClPGOColdFuncAttr( fanju110 wrote: > Addi

[clang] [lld] [llvm] [mlir] [NFC] Use more isa and isa_and_nonnull instead dyn_cast for predicates (PR #137393)

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

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-04-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > So the changes needed to move this patch forward are to only perform the > > attribute check when we're checking for a valid redefinition, not type > > compatibility in general. A follow-up to improve upon this can do the > > layout check when looking for compatibility.

[clang] [clang][AArch64] Don't #define __ARM_FEATURE_CRC32 when -crc is specified in -target-feature (PR #132167)

2025-04-28 Thread via cfe-commits
https://github.com/XiaShark updated https://github.com/llvm/llvm-project/pull/132167 >From 3be462100386014b3f78c1db5369487235a2bcf0 Mon Sep 17 00:00:00 2001 From: XiaShark Date: Thu, 20 Mar 2025 14:32:30 +0800 Subject: [PATCH] [clang][AArch64] Don't define features macros when explicitly disab

[clang] [clang][AArch64] Don't define features macros when explicitly disabled (PR #132167)

2025-04-28 Thread via cfe-commits
https://github.com/XiaShark edited https://github.com/llvm/llvm-project/pull/132167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AArch64] Don't define features macros when explicitly disabled (PR #132167)

2025-04-28 Thread via cfe-commits
https://github.com/XiaShark edited https://github.com/llvm/llvm-project/pull/132167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -28,6 +28,7 @@ #include "flang/Semantics/unparse-with-symbols.h" #include "flang/Support/default-kinds.h" #include "flang/Tools/CrossToolHelpers.h" +#include "clang/CodeGen/BackendUtil.h" tarunprabhu wrote: We should not include clang headers unless necessa

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -19,6 +21,7 @@ template class Expected; template class IntrusiveRefCntPtr; class Module; class MemoryBufferRef; +extern cl::opt ClPGOColdFuncAttr; tarunprabhu wrote: Since this is an experimental option that will likely be removed and is only to be used

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -13,9 +13,14 @@ #ifndef LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H #define LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H +#include "llvm/ProfileData/InstrProfCorrelator.h" +#include namespace llvm { class Triple; class TargetLibraryInfoImpl; +extern llvm::cl::opt DebugInfoCorrelate;

[clang] [clang] Remove FEM_Indeterminable (PR #137247)

2025-04-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Why did this get merged before there were any reviews or responses? https://github.com/llvm/llvm-project/pull/137247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu requested changes to this pull request. Thanks for the updating the PR. There seems to be a [buildkite failure](https://buildkite.com/llvm-project/github-pull-requests/builds/173137#01967cab-3f69-4ec6-8175-49795d1a2819). These failures are often worth checking b

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -20,8 +20,13 @@ #include "mlir/IR/OwningOpRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include +namespace llvm { +extern cl::opt ClPGOColdFuncAttr; tarunp

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tom Eccles via cfe-commits
@@ -8,6 +8,8 @@ #ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include "clang/Basic/LLVM.h" #include "llvm/IR/ModuleSummaryIndex.h" tblah wrote

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tom Eccles via cfe-commits
@@ -19,6 +21,7 @@ template class Expected; template class IntrusiveRefCntPtr; class Module; class MemoryBufferRef; +extern cl::opt ClPGOColdFuncAttr; tblah wrote: nit: I would put this `extern` in `BackendUtil.cpp` because it is not part of BackendUtils's p

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove FEM_Indeterminable (PR #137247)

2025-04-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/137247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: sorry! I made these comments a while ago, but apparently never submitted them. https://github.com/llvm/llvm-project/pull/137234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -10416,6 +10447,15 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, // Finally, we know we have the right number of parameters, install them. NewFD->setParams(Params); + // If this declarator is a declaration and not a definition, its paramet

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

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

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

[clang] [clang] Remove FEM_Indeterminable (PR #137247)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @zahiraam it's currently causing a warning (@Endilll asking for an update is why I ended up looking at this on my phone) https://github.com/llvm/llvm-project/pull/137247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang] Remove FEM_Indeterminable (PR #137247)

2025-04-28 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > @zahiraam it's currently causing a warning (@Endilll asking for an update is > why I ended up looking at this on my phone) What is the warning? https://github.com/llvm/llvm-project/pull/137247 ___ cfe-commits mailing list cfe-commi

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: thanks, it looks much better https://github.com/llvm/llvm-project/pull/134522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-28 Thread Younan Zhang via cfe-commits
@@ -4348,6 +4348,23 @@ struct PartialSpecMatchResult { VarTemplatePartialSpecializationDecl *Partial; TemplateArgumentList *Args; }; + +struct TemplateArgEqualityComparator { + const ASTContext &Context; + + bool operator()(const TemplateArgument &Canonical, +

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/134522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement lowering for LinkageSpecDecl (PR #137634)

2025-04-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/137634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-04-28 Thread via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: llvmbot wrote: @llvm/pr-subscribers-clang Author: Juan Manuel Martinez Caamaño (jmmartinez) Changes This is a draft while I'm trying to figure out what's left to do. This has issues with the test `Modules/initializers.cp

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Fraser Cormack via cfe-commits
@@ -155,3 +155,11 @@ #endif #pragma OPENCL EXTENSION cl_amd_media_ops2: enable +#if (__OPENCL_C_VERSION__ >= 300) frasercrmck wrote: My reading of the specification is that OpenCL 2.0 has the "generic address space" capability available by default, but not t

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-04-28 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez created https://github.com/llvm/llvm-project/pull/137665 This is a draft while I'm trying to figure out what's left to do. This has issues with the test `Modules/initializers.cpp`. The function `CompilerInstance::createModuleFromSource` creates a `FrontendInput`

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-28 Thread David Rivera via cfe-commits
RiverDave wrote: > @RiverDave Do you have permissions to land the PR, or shall I do it for you? Don't have permissions [yet](https://github.com/issues/created?issue=llvm%7Cllvm-project%7C131971)... You can merge it for me! https://github.com/llvm/llvm-project/pull/134774 _

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Juan Manuel Martinez Caamaño via cfe-commits
@@ -155,3 +155,11 @@ #endif #pragma OPENCL EXTENSION cl_amd_media_ops2: enable +#if (__OPENCL_C_VERSION__ >= 300) jmmartinez wrote: Thanks ! You're right. It's available by default on OpenCL C 2 but not 3. https://github.com/llvm/llvm-project/pull/137636 ___

[clang-tools-extra] [clangd] Add CodePatterns config option under Completion (PR #137613)

2025-04-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 HEAD~1 HEAD --extensions h,cpp -- clang-tools-extra/clangd/ClangdServer.cpp clang-to

[clang] [C] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

2025-04-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137658 >From 0922c27f28eadd657086fd9eb0a68ab14ce37307 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 28 Apr 2025 11:56:40 -0400 Subject: [PATCH 1/2] Add new -Wimplicit-int-enum-cast to -Wc++-compat This

[clang] [clang] Merge gtest binaries into AllClangUnitTests (PR #134196)

2025-04-28 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/134196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137675 This PR makes `CompilerInvocation` the sole owner of the `LangOptions` instance. >From 14469a8726fc1d038f41c7e3e29a84ec8f52d013 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 Aug 2024 08:45:08 -0

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This PR makes `CompilerInvocation` the sole owner of the `LangOptions` instance. --- Full diff: https://github.com/llvm/llvm-project/pull/137675.diff 5 Files Affected: - (modified) clang/include/clang/

[clang] [sanitizer] Allow use-after-scope front-end argument to take effect with -fsanitize=kernel-address (PR #137015)

2025-04-28 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > However, please be aware that default for Asan is ON. Should Kasan default > > be OFF in the beginning? > > @vitalybuka I'm not sure how many users test a kernel exclusively in `-O0`, > but to those who do, I suppose defaulting this to ON could allow the > sanitizer to c

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -176,6 +185,9 @@ class DXILPrepareModule : public ModulePass { VersionTuple ValVer = MetadataInfo.ValidatorVersion; bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0; +// construct whitelist of valid metadata node kinds bogn

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-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 HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/Frontend/ASTUnit.h clang/inclu

[clang] [sanitizer] Allow use-after-scope front-end argument to take effect with -fsanitize=kernel-address (PR #137015)

2025-04-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/137015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Diagnose declarations hidden in C++ (PR #137368)

2025-04-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, that function could be cleaned up a bit, else LGTM. https://github.com/llvm/llvm-project/pull/137368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [C] Diagnose declarations hidden in C++ (PR #137368)

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

[clang] [C] Diagnose declarations hidden in C++ (PR #137368)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -1428,6 +1428,17 @@ bool DeclContext::Encloses(const DeclContext *DC) const { return false; } +bool DeclContext::LexicallyEncloses(const DeclContext *DC) const { + if (getPrimaryContext() != this) +return getPrimaryContext()->LexicallyEncloses(DC); + + for (; DC; DC

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-28 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt approved this pull request. https://github.com/llvm/llvm-project/pull/137004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for the updates https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-28 Thread Tom Eccles via cfe-commits
@@ -20,8 +20,13 @@ #include "mlir/IR/OwningOpRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include +namespace llvm { +extern cl::opt ClPGOColdFuncAttr; +} // namespace llvm --

[libclc] [libclc][NFC] Remove unary_builtin.inc (PR #137656)

2025-04-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137656 We had two ways of achieving the same thing. This commit removes unary_builtin.inc in favour of the approach combining gentype.inc with unary_def.inc. There is no change to the codegen for any target. >Fr

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

[clang] [Clang][AArch64] Add pessimistic vscale_range when sve is in target-f… (PR #137624)

2025-04-28 Thread David Sherwood via cfe-commits
@@ -794,14 +795,22 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction) const { + bool IsArmStreamingFunc

[clang] [clang] Remove FEM_Indeterminable (PR #137247)

2025-04-28 Thread Zahira Ammarguellat via cfe-commits
zahiraam wrote: > > I've reverted, not sure why I thought it had been reviewed? > > Thanks! And I'm happy enough blaming GitHub's poor Ux for all confusion. :-) > > @zahiraam -- any chance you can look into this? Yes I can in a couple of days. @ojhunt I hope this is OK? https://github.com/llv

[clang] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

2025-04-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/137658 This introduces a new diagnostic group to diagnose implicit casts from int to an enumeration type. In C, this is valid, but it is not compatible with C++. Additionally, this moves the "implicit conversion

[clang] [C] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes This introduces a new diagnostic group to diagnose implicit casts from int to an enumeration type. In C, this is valid, but it is not compatible with C++. Additionally, this moves the "implicit convers

[clang] [C] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

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

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Juan Manuel Martinez Caamaño via cfe-commits
@@ -155,3 +155,11 @@ #endif #pragma OPENCL EXTENSION cl_amd_media_ops2: enable +#if (__OPENCL_C_VERSION__ >= 300) jmmartinez wrote: I don't understand, isn't `__opencl_c_generic_address_space` available by default with `OPENCL_C_VERSION >= 200` (from reading

[clang] [sanitizer] Allow use-after-scope front-end argument to take effect with -fsanitize=kernel-address (PR #137015)

2025-04-28 Thread via cfe-commits
dgg5503 wrote: Ping for @vitalybuka , I'll merge this in by EOD if there are no objections based on my latest comment (for real this time 😀). https://github.com/llvm/llvm-project/pull/137015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137234 >From 56a3f3cd282e9bd5ef9014e4125380e0d9685121 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 24 Apr 2025 14:17:42 -0400 Subject: [PATCH 01/12] [C] Diagnose use of C++ keywords in C This adds a ne

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: After talking with Erich offline, I've updated the implementation to use a binary_search. The pointers are being cast to `uintptr_t` so that the `llvm::sort()` isn't operating on unrelated pointers. https://github.com/llvm/llvm-project/pull/137234 __

[clang] [CIR] Implement lowering for LinkageSpecDecl (PR #137634)

2025-04-28 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper approved this pull request. https://github.com/llvm/llvm-project/pull/137634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

2025-04-28 Thread Amr Hesham via cfe-commits
@@ -373,8 +373,27 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, elements, typedFiller); } case APValue::Vector: { -cgm.errorNYI("ConstExprEmitter::tryEmitPrivate vector"); -return {}; +const QualType eleme

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

2025-04-28 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/137511 >From 153f0c0daa33b1c71ced4a0f050d49656e72f505 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sat, 26 Apr 2025 18:43:00 +0200 Subject: [PATCH 1/2] [CIR] Upstream global initialization for VectorType ---

[clang] [CIR][NFC] Fix an unused variable warning (PR #137466)

2025-04-28 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/137466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e44f776 - [CIR][NFC] Fix an unused variable warning (#137466)

2025-04-28 Thread via cfe-commits
Author: Amr Hesham Date: 2025-04-28T19:06:20+02:00 New Revision: e44f7760fa6f9f2d70831a6e9bf9f8472d285f4d URL: https://github.com/llvm/llvm-project/commit/e44f7760fa6f9f2d70831a6e9bf9f8472d285f4d DIFF: https://github.com/llvm/llvm-project/commit/e44f7760fa6f9f2d70831a6e9bf9f8472d285f4d.diff LO

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-04-28 Thread zhijian lin via cfe-commits
https://github.com/diggerlin created https://github.com/llvm/llvm-project/pull/137670 1. The PR proceeds with a backend target hook to allow front-ends to determine what features are available in a compilation based on the CPU name. 2. Fix a backend target feature bug that supports HTM for Powe

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: zhijian lin (diggerlin) Changes 1. The PR proceeds with a backend target hook to allow front-ends to determine what features are available in a compilation based on the CPU name. 2. Fix a backend target fe

[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

2025-04-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 HEAD~1 HEAD --extensions c,h,cpp -- clang/lib/Basic/Targets/PPC.cpp clang/test/CodeG

[clang] [clang] Merge gtest binaries into AllClangUnitTests (PR #134196)

2025-04-28 Thread Reid Kleckner via cfe-commits
https://github.com/rnk updated https://github.com/llvm/llvm-project/pull/134196 >From 528be44ebae8ea5cd7f23c51ad11c314a73f152b Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 28 Mar 2025 22:11:05 -0700 Subject: [PATCH 1/8] [clang] Merge gtest binaries into AllClangUnitTests This reduces

[clang] [llvm] [ARM] Adding diagnostics for mcmodel=tiny when used in invalid targets (PR #125643)

2025-04-28 Thread via cfe-commits
@@ -1755,6 +1755,18 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { << TC.getTriple().str(); } + // Throw diagnosis if mcmodel=tiny option is passed for targets other than ARM + // or AArch64. + if (Arg *A = UArgs->getLastArg(options::OPT_mcmodel_EQ)

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-04-28 Thread Krzysztof Drewniak via cfe-commits
krzysz00 wrote: @jayfoad I still think we need an intrinsic here because a load + an addtid store can be scheduled much different from the asynchronous "gather to LDS" - and because we don't want this load/store to not be optimized https://github.com/llvm/llvm-project/pull/137425 _

[clang] c52fdbe - [clang][bytecode] Fix ia32_addcarry/subborrow (#137642)

2025-04-28 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-28T17:44:19+02:00 New Revision: c52fdbe697eb0eee2484c5bf1aeb17d678430830 URL: https://github.com/llvm/llvm-project/commit/c52fdbe697eb0eee2484c5bf1aeb17d678430830 DIFF: https://github.com/llvm/llvm-project/commit/c52fdbe697eb0eee2484c5bf1aeb17d678430830.diff L

[clang] [clang][bytecode] Fix ia32_addcarry/subborrow (PR #137642)

2025-04-28 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/137642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -10416,6 +10447,15 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, // Finally, we know we have the right number of parameters, install them. NewFD->setParams(Params); + // If this declarator is a declaration and not a definition, its paramet

[clang] [C] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

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

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/137661 Remove FEM_Indeterminable as it is unused and cannot be stored safely in an unsigned bitfield >From a33b76cb769b8669922101c9cb7b9fbb28cbb1fe Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Thu, 24 Apr 2025 13:

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: @Endilll this is the fix for the warning you're seeing https://github.com/llvm/llvm-project/pull/137661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: (Recreating after mismerge) https://github.com/llvm/llvm-project/pull/137661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oliver Hunt (ojhunt) Changes Remove FEM_Indeterminable as it is unused and cannot be stored safely in an unsigned bitfield --- Full diff: https://github.com/llvm/llvm-project/pull/137661.diff 3 Files Affected: - (modified) clang/includ

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/137163 From 99fa9a1f5fb74401c790871e6eb1ce473d048d74 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 24 Apr 2025 11:12:00 +0200 Subject: [PATCH 1/3] [clang][CompundLiteralExpr] Don't defer evaluation for CL

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

[clang] [lld] [llvm] [X86] Add pass to suppress EPGR/NDD instructions for relocations (PR #136660)

2025-04-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 HEAD~1 HEAD --extensions cpp,h -- llvm/lib/Target/X86/X86SuppressAPXForReloc.cpp llv

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. You can remove the `Params.empty` if you'd like, but this LGTM anyway. https://github.com/llvm/llvm-project/pull/137234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

[clang] f8724bd - [clang][bytecode] Check live-ness when calling dtors (#137645)

2025-04-28 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-28T17:47:30+02:00 New Revision: f8724bd873878df81720bdec8b7a9a24f2a40a03 URL: https://github.com/llvm/llvm-project/commit/f8724bd873878df81720bdec8b7a9a24f2a40a03 DIFF: https://github.com/llvm/llvm-project/commit/f8724bd873878df81720bdec8b7a9a24f2a40a03.diff L

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Erich Keane via cfe-commits
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) { + if (!II) +return false; + + // Build a static map of

  1   2   3   4   5   6   >