[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg approved this pull request. The backend looks good to me! (after resolving my last comments of course) Thanks for adding this feature! https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-09 Thread Ellis Hoag via cfe-commits
@@ -319,6 +319,29 @@ static cl::opt PGOFunctionCriticalEdgeThreshold( cl::desc("Do not instrument functions with the number of critical edges " " greater than this threshold.")); +static cl::opt ColdFuncCoverageMaxEntryCount( +"cold-function-coverage-max-e

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Ben Langmuir via cfe-commits
@@ -450,58 +458,65 @@ class FullDeps { ModuleIDs.push_back(M.first); llvm::sort(ModuleIDs); -using namespace llvm::json; - -Array OutModules; -for (auto &&ModID : ModuleIDs) { - auto &MD = Modules[ModID]; - Object O{{"name", MD.ID.ModuleName}, -

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/111734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
@@ -4453,9 +4453,9 @@ class Sema final : public SemaBase { SourceLocation *ArgLocation = nullptr); /// Determine if type T is a valid subject for a nonnull and similar - /// attributes. By default, we look through references (the behavi

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/111573 >From a0066f706b1173afe573ddd5f79cb5c8916a19cf Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Tue, 8 Oct 2024 20:12:45 +0200 Subject: [PATCH] [clang] assume_aligned incorrectly diagnoses a dependent ret

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. https://github.com/llvm/llvm-project/pull/111573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
@@ -4453,9 +4453,10 @@ class Sema final : public SemaBase { SourceLocation *ArgLocation = nullptr); /// Determine if type T is a valid subject for a nonnull and similar - /// attributes. By default, we look through references (the behav

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

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

[clang] [clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores unsigned consts (PR #101073)

2024-10-09 Thread Chris Warner via cfe-commits
cwarner-8702 wrote: @5chmidti I agree. Do you know how I can get the attention of someone more familiar with clang internals, or who that might be? https://github.com/llvm/llvm-project/pull/101073 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
@@ -4453,9 +4453,10 @@ class Sema final : public SemaBase { SourceLocation *ArgLocation = nullptr); /// Determine if type T is a valid subject for a nonnull and similar - /// attributes. By default, we look through references (the behav

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/111573 >From 0f1405efdbb6a9bc24c878346d96ae6720771a44 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Tue, 8 Oct 2024 20:12:45 +0200 Subject: [PATCH] [clang] assume_aligned incorrectly diagnoses a dependent ret

[clang] [Clang] fix overload resolution for object parameters with top-level cv-qualifiers in member functions (PR #110435)

2024-10-09 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/110435 >From c52634882631a71fad956a70179b480abf13006a Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 29 Sep 2024 22:01:38 +0300 Subject: [PATCH 1/3] [Clang] fix overload resolution for object parameters with

[clang] [llvm] [AArch64] Introduce new armv9.6 features (PR #111677)

2024-10-09 Thread Jonathan Thackray via cfe-commits
@@ -522,6 +522,39 @@ def FeatureTLBIW : ExtensionWithMArch<"tlbiw", "TLBIW", "FEAT_TLBIW", // Armv9.6 Architecture Extensions //===--===// +def FeatureCMPBR : ExtensionWithMArch<"cmpbr", "CMPBR", "FEAT_CMPB

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-09 Thread Piotr Zegar via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: https://github.com/PiotrZSL commented: Code looks fine. Only thing is that existence of SuppressInlineNamespace and AlwaysSuppressInlineNamespace looks redundant. Probably one should be named SuppressRedundantInlineNamespace and othe

[clang] [llvm] [AArch64] Introduce new armv9.6 features (PR #111677)

2024-10-09 Thread Jonathan Thackray via cfe-commits
@@ -522,6 +522,39 @@ def FeatureTLBIW : ExtensionWithMArch<"tlbiw", "TLBIW", "FEAT_TLBIW", // Armv9.6 Architecture Extensions //===--===// +def FeatureCMPBR : ExtensionWithMArch<"cmpbr", "CMPBR", "FEAT_CMPB

[clang] [llvm] [AArch64] Introduce new armv9.6 features (PR #111677)

2024-10-09 Thread Jonathan Thackray via cfe-commits
@@ -522,6 +522,39 @@ def FeatureTLBIW : ExtensionWithMArch<"tlbiw", "TLBIW", "FEAT_TLBIW", // Armv9.6 Architecture Extensions //===--===// +def FeatureCMPBR : ExtensionWithMArch<"cmpbr", "CMPBR", "FEAT_CMPB

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 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 91fdfec263ff2b8e88433c4294a550cabb0f2314 d4df259bb3cf88d1540b836a6aaa7622751b0287 --e

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 Thread Donát Nagy via cfe-commits
@@ -314,6 +329,193 @@ getFuchsiaHandleSymbols(QualType QT, SVal Arg, ProgramStateRef State) { return {}; } +FuchsiaHandleChecker::Note FuchsiaHandleChecker::createNote( +SymbolRef Sym, +std::function Message) const { + return [Sym, Message](BugReport &BR) -> std::s

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-10-09 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,63 @@ +//===-- clang/Support/Compiler.h - Compiler abstraction support -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/111588 >From a3805292ea37cf06d1cf227768034b30a42a685f Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Mon, 7 Oct 2024 23:01:24 +0300 Subject: [PATCH 1/5] wip: initial versio --- .../Checkers/FuchsiaHandleChecker.

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-09 Thread Nikita Popov via cfe-commits
nikic wrote: The invoke merging problem still exists, though the impact dropped: ``` simplifycfg.NumInvokesMerged 136372 -> 136185 -0.14% ``` Need to adjust this: https://github.com/llvm/llvm-project/blob/774893dcd929c370bad714a70a7d670bb2d6f649/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L2782

[clang] [clang][bytecode] Diagnose class-specific operator delete calls (PR #111700)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111700 None >From e4ec0569603e78f82939d179b06839d2bc3deed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 17:30:44 +0200 Subject: [PATCH] [clang][bytecode] Diagnose class-specific

[clang] [clang][bytecode] Diagnose class-specific operator delete calls (PR #111700)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111700.diff 5 Files Affected: - (modified) clang/lib/AST/ByteCode/Compiler.cpp (+1-1) - (modified) clang/lib/AST/ByteCode/Interp.cpp (+84-1) - (m

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
@@ -4453,9 +4453,9 @@ class Sema final : public SemaBase { SourceLocation *ArgLocation = nullptr); /// Determine if type T is a valid subject for a nonnull and similar - /// attributes. By default, we look through references (the behavi

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: This part in ObjectiveC tests conflict with the current solution, any suggestion how we can go around it right now until to be handled later https://github.com/llvm/llvm-project/blob/18952bdcd6f987620e6396261c2bb444e428e07e/clang/test/SemaObjCXX/noescape.mm#L202-L205 @erich

[clang] [clang] assume_aligned incorrectly diagnoses a dependent return type (PR #111573)

2024-10-09 Thread Erich Keane via cfe-commits
erichkeane wrote: > This part in ObjectiveC tests conflict with the current solution, any > suggestion how we can go around it right now until to be handled later > > https://github.com/llvm/llvm-project/blob/18952bdcd6f987620e6396261c2bb444e428e07e/clang/test/SemaObjCXX/noescape.mm#L202-L205 >

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/111753 This is a follow-up to https://github.com/llvm/llvm-project/pull/108344. The original bailout check was overly strict, causing it to miss cases like the vector(initializer_list, allocator) constructor. This patc

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes This is a follow-up to https://github.com/llvm/llvm-project/pull/108344. The original bailout check was overly strict, causing it to miss cases like the vector(initializer_list, allocator) constructor. This pat

[clang-tools-extra] [clang-tidy] insert ``static`` keyword in correct position for misc-use-internal-linkage (PR #108792)

2024-10-09 Thread Julian Schmidt via cfe-commits
@@ -110,10 +113,36 @@ static constexpr StringRef Message = "%0 %1 can be made static or moved into an anonymous namespace " "to enforce internal linkage"; +static SourceLocation getQualifiedTypeStartLoc(SourceLocation L, 5chmidti wrote: You could use

[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

2024-10-09 Thread Matt Arsenault via cfe-commits
@@ -91,6 +97,88 @@ SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, setRequiresStructuredCFG(false); } +enum AddressSpace { + Function = storageClassToAddressSpace(SPIRV::StorageClass::Function), + CrossWorkgroup = + storageClassToAddressSpac

[clang-tools-extra] [clang-tidy] support `return c ? a : b;` in bugprone-return-const-ref-from-parameter (PR #107657)

2024-10-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti updated https://github.com/llvm/llvm-project/pull/107657 >From b00b02b3d92a88fcf7d688b39d52e74e59f76ecd Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Sat, 7 Sep 2024 01:54:38 +0200 Subject: [PATCH 1/2] [clang-tidy] support `return c ? a : b;` in bugprone-retur

[clang-tools-extra] [clang-tidy] support `return c ? a : b;` in bugprone-return-const-ref-from-parameter (PR #107657)

2024-10-09 Thread Julian Schmidt via cfe-commits
@@ -15,20 +16,24 @@ using namespace clang::ast_matchers; namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher( - returnStmt( - hasReturnValue(declRefExpr( - to(parmVarD

[clang] Switch DirectX Target to use the Itanium ABI (PR #111632)

2024-10-09 Thread S. Bharadwaj Yadavalli via cfe-commits
https://github.com/bharadwajy approved this pull request. https://github.com/llvm/llvm-project/pull/111632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][HLSL] Add sign intrinsic part 4 (PR #108396)

2024-10-09 Thread Farzon Lotfi via cfe-commits
farzonl wrote: @tgymnich I think its time for you to ask for commit access. Follow these steps: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access https://github.com/llvm/llvm-project/pull/108396 ___ cfe-commits mailing list cfe-commit

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/111753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
@@ -404,7 +404,7 @@ shouldTrackFirstArgumentForConstructor(const CXXConstructExpr *Ctor) { if (LHSRecordDecl->hasAttr()) return true; - if (Ctor->getConstructor()->getNumParams() != 1 || + if (Ctor->getConstructor()->getNumParams() < 1 || usx95 wrote:

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. LGTM. Thanks for the quick fix. https://github.com/llvm/llvm-project/pull/111753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][AArch64] Add getHostCPUFeatures to query for enabled features in cpu info (PR #97749)

2024-10-09 Thread David Green via cfe-commits
@@ -70,6 +70,10 @@ static std::unique_ptr LLVM_ATTRIBUTE_UNUSED getProcCpuinfoContent() { llvm::ErrorOr> Text = llvm::MemoryBuffer::getFileAsStream("/proc/cpuinfo"); + if (const char *cpuinfoIntercept = std::getenv("LLVM_CPUINFO")) { +Text = llvm::MemoryBuffer:

[clang] [llvm] [clang][AArch64] Add getHostCPUFeatures to query for enabled features in cpu info (PR #97749)

2024-10-09 Thread David Green via cfe-commits
@@ -70,6 +70,10 @@ static std::unique_ptr LLVM_ATTRIBUTE_UNUSED getProcCpuinfoContent() { llvm::ErrorOr> Text = llvm::MemoryBuffer::getFileAsStream("/proc/cpuinfo"); + if (const char *cpuinfoIntercept = std::getenv("LLVM_CPUINFO")) { davemgreen wro

[clang] [llvm] [clang][AArch64] Add getHostCPUFeatures to query for enabled features in cpu info (PR #97749)

2024-10-09 Thread David Green via cfe-commits
https://github.com/davemgreen edited https://github.com/llvm/llvm-project/pull/97749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][AArch64] Add getHostCPUFeatures to query for enabled features in cpu info (PR #97749)

2024-10-09 Thread David Green via cfe-commits
https://github.com/davemgreen commented: Thanks for adding the tests. They look like a useful addition. https://github.com/llvm/llvm-project/pull/97749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [NFC][clang-tidy] Add type annotations to rename_check.py (PR #108443)

2024-10-09 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. https://github.com/llvm/llvm-project/pull/108443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > I realize this is not the approach you had in mind, but it would at least be > nice to hear the reasoning as to why something more elaborate would be > preferred? Manually writing addParamAttr markings doesn't scale; there's no easy way to audit whether everything has b

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/111588 >From a3805292ea37cf06d1cf227768034b30a42a685f Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Mon, 7 Oct 2024 23:01:24 +0300 Subject: [PATCH 1/4] wip: initial versio --- .../Checkers/FuchsiaHandleChecker.

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 Thread Pavel Skripkin via cfe-commits
@@ -99,6 +99,7 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/Progr

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Reduced to: ```cpp template struct A { template static constexpr int f(); }; template<> template constexpr int A<0>::f() { return A<1>::f(); } template<> template constexpr int A<1>::f() { return J; } static_assert(A<0>::f<2>() == 2); // error: static assertio

[clang] [llvm] [AArch64] Introduce new armv9.6 features (PR #111677)

2024-10-09 Thread Jonathan Thackray via cfe-commits
@@ -522,6 +522,39 @@ def FeatureTLBIW : ExtensionWithMArch<"tlbiw", "TLBIW", "FEAT_TLBIW", // Armv9.6 Architecture Extensions //===--===// +def FeatureCMPBR : ExtensionWithMArch<"cmpbr", "CMPBR", "FEAT_CMPB

[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

2024-10-09 Thread Pavel Skripkin via cfe-commits
@@ -267,12 +286,128 @@ class FuchsiaHandleSymbolVisitor final : public SymbolVisitor { private: SmallVector Symbols; }; + +class FuchsiaBugVisitor final : public BugReporterVisitor { + // Handle that caused a problem. + SymbolRef Sym; + + bool IsLeak; + +public: + Fuchsi

[clang] [Clang] Add explicit visibility symbol macros (PR #108276)

2024-10-09 Thread Thomas Fransham via cfe-commits
https://github.com/fsfod updated https://github.com/llvm/llvm-project/pull/108276 >From fff6064a63ddf85857ea5036333866317a156ffc Mon Sep 17 00:00:00 2001 From: Thomas Fransham Date: Tue, 10 Sep 2024 02:22:18 +0100 Subject: [PATCH 1/8] [Clang] Add explicit visibility symbol macros and update CM

[clang] [clang][bytecode] Only allow lossless ptr-to-int casts (PR #111669)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/111669 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: FWIW https://github.com/llvm/llvm-project/commit/4336f00f2156970cc0af2816331387a0a4039317 does not really depend on this patch significantly, the same change more or less should work, you just need to adjust for the changes in the function signature. https://github.com/llvm/l

[clang] [clang] Update string and string_view in lifetimebound tests (PR #111737)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/111737 >From 6e8a4c942708aa11b0c2a735881b5a368f97580d Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Wed, 9 Oct 2024 18:41:19 + Subject: [PATCH 1/2] [clang] Update string and string_view in lifetimebound tests

[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

2024-10-09 Thread Matt Arsenault via cfe-commits
@@ -91,6 +97,88 @@ SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, setRequiresStructuredCFG(false); } +enum AddressSpace { + Function = storageClassToAddressSpace(SPIRV::StorageClass::Function), + CrossWorkgroup = + storageClassToAddressSpac

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 Thread Jonas Paulsson via cfe-commits
https://github.com/JonPsson1 created https://github.com/llvm/llvm-project/pull/111740 Add extension attributes in declarations of _Block_object_dispose and _Block_object_assign. In order to make this one-liners wherever needed, a new casting method FunctionCallee::getAsFunction() has been add

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jonas Paulsson (JonPsson1) Changes Add extension attributes in declarations of _Block_object_dispose and _Block_object_assign. In order to make this one-liners wherever needed, a new casting method FunctionCallee::getAsFunction() has bee

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Jonas Paulsson (JonPsson1) Changes Add extension attributes in declarations of _Block_object_dispose and _Block_object_assign. In order to make this one-liners wherever needed, a new casting method FunctionCallee::getAsFunction()

[clang] [HIP] Use original file path for CUID (PR #107734)

2024-10-09 Thread Artem Belevich via cfe-commits
@@ -16,15 +18,15 @@ // RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \ // RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \ -// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1 +// RUN: Inputs/hip_multiple_

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 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 e1a073c9d9b85804c46353c5a66c44fe212525ed fb8b76aca00b97166e56fcaefc241850b2535f94 --e

[clang] [clang][HLSL] Add sign intrinsic part 4 (PR #108396)

2024-10-09 Thread Sarah Spall via cfe-commits
https://github.com/spall approved this pull request. https://github.com/llvm/llvm-project/pull/108396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix overload resolution for object parameters with top-level cv-qualifiers in member functions (PR #110435)

2024-10-09 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/110435 >From c52634882631a71fad956a70179b480abf13006a Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 29 Sep 2024 22:01:38 +0300 Subject: [PATCH 1/3] [Clang] fix overload resolution for object parameters with

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Rahul Joshi (jurahul) Changes Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will have beh

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-clang Author: Rahul Joshi (jurahul) Changes Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclarati

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Rahul Joshi (jurahul) Changes Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will have be

[clang] [-Wunsafe-buffer-usage] Add user documentation. (PR #111624)

2024-10-09 Thread via cfe-commits
https://github.com/jkorous-apple approved this pull request. LGTM. Thank you! https://github.com/llvm/llvm-project/pull/111624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-10-09 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-ppc64le-linux` running on `ppc64le-sanitizer` while building `clang,llvm` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/72/builds/4173 Here is the relevant piece of t

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
https://github.com/pow2clk commented: I'm a bit out of my depth here, but I've been trying to understand Itanium mangling better and I think my suggestion to coalesce the vendor mangled portions is valid at least. https://github.com/llvm/llvm-project/pull/110327 ___

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { } void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { - mangleType(T->getWrappedType()); + llvm::SmallString<64> Str("_Res"); const HLSLAttributedResourceType::Attri

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { } void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { - mangleType(T->getWrappedType()); + llvm::SmallString<64> Str("_Res"); const HLSLAttributedResourceType::Attri

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
@@ -11533,6 +11539,18 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer, return {}; return LHS; } + case Type::HLSLAttributedResource: { +const HLSLAttributedResourceType *LHSTy = +LHS->castAs(); +const HLSLAttribut

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
https://github.com/pow2clk edited https://github.com/llvm/llvm-project/pull/110327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

2024-10-09 Thread Greg Roth via cfe-commits
@@ -4492,6 +4492,37 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { mangleType(cast(T)); } +void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { + llvm::SmallString<64> Str("_Res"); + const HLSLAttributedResourceType::Attributes &Attrs

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Rahul Joshi (jurahul) Changes Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will have beh

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-webassembly Author: Rahul Joshi (jurahul) Changes Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will hav

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-09 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul ready_for_review https://github.com/llvm/llvm-project/pull/111752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

2024-10-09 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: Changing the `struct_size` macro in the kernel [1] would likely be an unreasonable amount of work. To quote Kees from the kernel mailing list [2]: > [...] if we want to change struct_size(), then we must (via allmodconfig builds) determine all the places in the kernel where the cal

[clang] [clang] Catch missing format attributes (PR #105479)

2024-10-09 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec updated https://github.com/llvm/llvm-project/pull/105479 From 4d5ab7ffd0178f8f4a76221e81a5c7b270dc92e4 Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 5 Apr 2024 15:20:37 +0200 Subject: [PATCH] [clang] Catch missing format attribute

[clang] [clang][RISCV] Correct the SEW operand of indexed/fault only first segment intrinsics (PR #111476)

2024-10-09 Thread Jerry Zhang Jian via cfe-commits
jerryzj wrote: This patch seems to introduce a new compile-time warning ``` /llvm-project/clang/utils/TableGen/RISCVVEmitter.cpp:179:9: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] 179 | (RVVI->isMasked() && (RVVI->getPolicyAttrsBits() & RVV_VTA) &&

[clang] [clang] Catch missing format attributes (PR #105479)

2024-10-09 Thread Budimir Aranđelović via cfe-commits
@@ -5335,6 +5335,217 @@ static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) PreferredTypeAttr(S.Context, AL, ParmTSI)); } +// This function is called only if function call is not inside template body. +// TODO: Add call

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-09 Thread Alex Bradbury via cfe-commits
https://github.com/asb created https://github.com/llvm/llvm-project/pull/111657 Consistent with other cases for these tests, we opt not to add the target to check-all if they're known to fail. The tests fail when cross compiling for a different architecture because the host Python3_EXECUTABLE i

[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alex Bradbury (asb) Changes Consistent with other cases for these tests, we opt not to add the target to check-all if they're known to fail. The tests fail when cross compiling for a different architecture because the host Python3_EXECUTA

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-09 Thread Alex Bradbury via cfe-commits
asb wrote: > > Though now I write this, I'm thinking it would make more sense to set > > RUN_PYTHON_TESTS to FALSE if CMAKE_CROSSCOMPILING is set. What do you think? > > Yes, I like this direction much more. Probably you should also print a > message during configuration saying that those test

[clang] [C++20][Modules] Allow import for a header unit after #pragma (PR #111662)

2024-10-09 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin created https://github.com/llvm/llvm-project/pull/111662 Summary: `#pragma` and headers that finish with them shouldn't prevent `import "header_unit.h"` syntax. Test Plan: check-clang >From 300a567bd983754cc1187dc122f98c0f7d408b99 Mon Sep 17 00:00:00 2001 From: D

[clang] [Cuda] Handle -fcuda-short-ptr even with -nocudalib (PR #111682)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Fraser Cormack (frasercrmck) Changes When padded -nocudalib/-nogpulib, Cuda's argument handling would bail out before handling -fcuda-short-ptr, meaning the frontend and backend data layouts would mismatc

[clang] [clang][bytecode] Fix source range of uncalled base dtor (PR #111683)

2024-10-09 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/111683 Make this emit the same source range as the current interpreter. >From e9a62e3a7f0d14bde4c78f7b3abbd869bad8f4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 9 Oct 2024 16:03:32 +0200

[clang] [Cuda] Handle -fcuda-short-ptr even with -nocudalib (PR #111682)

2024-10-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/111682 When padded -nocudalib/-nogpulib, Cuda's argument handling would bail out before handling -fcuda-short-ptr, meaning the frontend and backend data layouts would mismatch. >From 67b4b2acf2a54a3a6e2d765714f32

[clang] [Cuda] Handle -fcuda-short-ptr even with -nocudalib (PR #111682)

2024-10-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/111682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Cuda] Handle -fcuda-short-ptr even with -nocudalib (PR #111682)

2024-10-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Seems reasonable, which architectures require this? https://github.com/llvm/llvm-project/pull/111682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang][bytecode] Fix source range of uncalled base dtor (PR #111683)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Make this emit the same source range as the current interpreter. --- Full diff: https://github.com/llvm/llvm-project/pull/111683.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/EvaluationResult.

[clang] [clang][x86] Missing `AVX512VP2INTERSECT` flag (PR #111435)

2024-10-09 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Nikolas Klauser via cfe-commits
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper { _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT { _Alias __val; - __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type)); + __builtin_memcpy(&__val, reinterpret_cast(std::_

[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

2024-10-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Please note: GCC is more strict; for std::memset, it requires the type to be trivial, not just trivially copyable: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107361 I haven't looked at the patch in detail but for consistency with GCC it should also support suppressing t

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-10-09 Thread Kyungwoo Lee via cfe-commits
@@ -74,6 +75,8 @@ static cl::opt ThinLTOAssumeMerged( cl::desc("Assume the input has already undergone ThinLTO function " "importing and the other pre-optimization pipeline changes.")); +extern cl::opt CodeGenDataThinLTOTwoRounds; kyulee-com w

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-10-09 Thread Kyungwoo Lee via cfe-commits
@@ -1513,6 +1522,171 @@ class InProcessThinBackend : public ThinBackendProc { return Error::success(); } }; + +/// This backend is utilized in the first round of a two-codegen round process. +/// It first saves optimized bitcode files to disk before the codegen process +/

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-09 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > > We already have hard-coded logic to disable adding these tests to the > > > `check-all` target in various cases. > > > > > > Why do you have to do that? > > I've never worked with the clang python bindings before, but you can > basically see the reasoning in > https://g

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-09 Thread Alex Bradbury via cfe-commits
https://github.com/asb edited https://github.com/llvm/llvm-project/pull/111367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-09 Thread Alex Bradbury via cfe-commits
https://github.com/asb closed https://github.com/llvm/llvm-project/pull/111367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][python] Add CLANG_DISABLE_RUN_PYTHON_TESTS CMake option to disable clang python bindings tests (PR #111367)

2024-10-09 Thread Alex Bradbury via cfe-commits
https://github.com/asb edited https://github.com/llvm/llvm-project/pull/111367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix out-of-bounds access to std::unique_ptr (PR #111581)

2024-10-09 Thread Louis Dionne via cfe-commits
ldionne wrote: Amazing to see this paying off! https://github.com/llvm/llvm-project/pull/111581 ___ 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   >