[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. This fixes the problem in #108567 https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
torshepherd wrote: > Hmm another case to consider: > > ![image](https://private-user-images.githubusercontent.com/49597791/372187742-193c9570-0e6b-47cd-8d8c-0279e727eac2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6I

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
4vtomat wrote: > Thanks everyone! 😄 Is there anything still blocking us from merging this? Actually no, let me merge it later today, thanks! https://github.com/llvm/llvm-project/pull/106914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-09-30 Thread Ameer J via cfe-commits
https://github.com/ameerj created https://github.com/llvm/llvm-project/pull/110560 Adds `**` support for `.clang-format-ignore` to support similar pattern matching to [.gitignore](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitignore.html#_pattern_format) closes #110160 >From b

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] workflows/release-binaries: Use static ZSTD on macOS (PR #109909)

2024-09-30 Thread Keith Smiley via cfe-commits
https://github.com/keith updated https://github.com/llvm/llvm-project/pull/109909 >From 8c6c06d0df5a17fd2ff4915c3de63695c18cd8dc Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 25 Sep 2024 05:38:04 + Subject: [PATCH 1/5] workflows/release-binaries: Use static ZSTD on macOS On macOS

[clang] [llvm] workflows/release-binaries: Use static ZSTD on macOS (PR #109909)

2024-09-30 Thread Tom Stellard via cfe-commits
@@ -109,3 +109,6 @@ set_final_stage_var(LLVM_ENABLE_PROJECTS "${LLVM_RELEASE_ENABLE_PROJECTS}" STRIN set_final_stage_var(CPACK_GENERATOR "TXZ" STRING) set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING) +if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin") + set_final_stage_var(

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== + +Finds nondeterministic usages of pointers in unordered containers. + +One canonical example is iteration across a container of poi

[clang] [llvm] Add cross builtins and cross HLSL function to DirectX and SPIR-V backend (PR #109180)

2024-09-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/109180 >From 3c58861f3e8c2f1333d0b36c6f5b7ba7f3d9e187 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 18 Sep 2024 12:20:19 -0700 Subject: [PATCH 1/7] add cross hlsl function --- clang/include/clang/Basic/Bu

[clang] [clang][CodeGen] Emit improved memory effects and return status for AsmStmt (PR #110510)

2024-09-30 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: We need documentation for the exact assumptions we're making here. Distinguishing between "volatile" and a "memory clobber" seems a bit aggressive... I mean, I'm not sure what gcc does here, but it seems like an extremely subtle distinction. Same wi

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/3] [HLSL] Treat `main` as any other function HLSL doesn't

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/110546 >From c966c604e8e40ddae4e738d6048bb7f87cfeeb25 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 30 Sep 2024 13:05:09 -0500 Subject: [PATCH 1/2] [HLSL] Treat `main` as any other function HLSL doesn't

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Chris B via cfe-commits
llvm-beanz wrote: > There is still logic elsewhere that sets the default entry point to "main", > right? This looks right to me. Yes, and we apply the HLSLShader attribute to main and key generating the entry off that in clangCodeGen. https://github.com/llvm/llvm-project/pull/110546 _

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/vabridgers updated https://github.com/llvm/llvm-project/pull/110471 >From 52e390899c6c58840e97f5fb1b67f171c178b6d6 Mon Sep 17 00:00:00 2001 From: einvbri Date: Thu, 26 Sep 2024 16:24:59 +0200 Subject: [PATCH] [clang-tidy] [analyzer] Nondeterministic pointer usage improvement

[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Run backdeployment CI on Github hosted runners (PR #109984)

2024-09-30 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/109984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,36 @@ +//===--- NondeterministicPointerUsageCheck.h - clang-tidy ---*- C++ -*-===// vabridgers wrote: Done, thanks https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
vabridgers wrote: > I wish we had something like this. It might be possible, but really really > challenging to implement. To me the problem is that the iteration or lookups > are not necessarily bad. And to determine if it's bad one needs to understand > how the result of the lookup or the in

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/67520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,1450 @@ +// Like the compiler, clang-tidy treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== vabridgers wrote: Will update, thanks! https://github.com/llvm/llvm-project/pull/110471 __

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl *D, RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size()); D->addAttr(RCA); + + if (const auto *FD = dy

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -179,6 +180,8 @@ class BugproneModule : public ClangTidyModule { CheckFactories.registerCheck( "bugprone-narrowing-conversions"); CheckFactories.registerCheck("bugprone-no-escape"); +CheckFactories.registerCheck( +"bugprone-nondeterministic-pointe

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,67 @@ +//===--- NondetermnisticPointerUsageCheck.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: Apache-2

[clang] [clang] WIP: Warn on mismatched RequiresCapability attributes (PR #67520)

2024-09-30 Thread Aaron Puchert via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/aaronpuchert commented: So the semantics here are: if there is any `requires_capability` attribute on a function, it needs to exactly match the set of `requires_capability` attributes on every previou

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -103,6 +103,10 @@ Improvements to clang-tidy New checks ^^ +- New check :doc:`bugprone-nondeterministic-pointer-usage EugeneZelenko wrote: See 19 Release Notes as example for such entries. https://github.com/llvm/llvm-project/pull/110471 _

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -153,6 +153,10 @@ RequiresExpr::RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc, std::copy(Requirements.begin(), Requirements.end(), getTrailingObjects()); RequiresExprBits.IsSatisfied |= Dependent; + RequiresExprBits.IsSatisfied &= + llvm::no

[clang] [Clang][CodeGen] Emit load of GEP after EmitMemberExpr (PR #110487)

2024-09-30 Thread Bill Wendling via cfe-commits
bwendling wrote: > This is sort of the same comment I've made on other related patches... but I > think the fundamental issue here is that StructAccessBase is skipping over > CK_LValueToRValue casts. Once you jump over such a cast, you're looking at > expressions which are at a different level

[clang] [clang] Fix the local parameter of void type inside the `Requires` expression. (PR #109831)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -9509,6 +9509,19 @@ Sema::ActOnStartRequiresExpr(SourceLocation RequiresKWLoc, PushDeclContext(BodyScope, Body); for (ParmVarDecl *Param : LocalParameters) { +if (Param->getType()->isVoidType()) { + if (LocalParameters.size() > 1) { +Diag(Param->getBeg

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
@@ -4,7 +4,7 @@ // SPIRV: error: '-fnative-half-type' option requires target HLSL Version >= 2018, but HLSL Version is 'hlsl2016' // valid: "spirv-unknown-vulkan-library" -// valid: define spir_func void @main() #0 { +// valid: define spir_func void @{{.*}}main{{.*}}() #0 { -

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
@@ -1472,3 +1472,56 @@ template struct Outer { }; }; Outer::Inner outerinner; + +void aggregate() { + struct NonAgg { +NonAgg() { } +[[clang::requires_explicit_initialization]] int f; // expected-warning {{'requires_explicit_initialization' attribute is ignored in

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
@@ -551,3 +551,14 @@ struct full_of_empty empty_test_2(void) { struct full_of_empty e; return e; // no-warning } + +struct with_explicit_field { + int x; + int y [[clang::requires_explicit_initialization]]; // expected-note 2{{'y' declared here}} higher-

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

2024-09-30 Thread Chris B via cfe-commits
@@ -4492,6 +4492,31 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) { mangleType(cast(T)); } +void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) { llvm-beanz wrote: I assume the intent is that we're mangling this as a vend

[clang] [clang][Itanium Mangle] Enable mangling of enclosing class for member… (PR #110503)

2024-09-30 Thread Richard Smith via cfe-commits
@@ -704,6 +704,15 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const Decl *D) { return D->getLexicalDeclContext()->getRedeclContext(); } + if (const auto *FTD = dyn_cast(D)) { +// Member-like constrained friends are mangled as if they were members of +

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm happy, pending Aaron's comments on the two diagnostic things. https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
@@ -1,7 +1,7 @@ // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ // RUN: spirv-pc-vulkan-library %s -emit-llvm -disable-llvm-passes -o - | FileCheck %s -// CHECK: define spir_func void @main() [[A0:#[0-9]+]] { +// CHECK: define spir_func void @{{.

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
@@ -551,3 +551,14 @@ struct full_of_empty empty_test_2(void) { struct full_of_empty e; return e; // no-warning } + +struct with_explicit_field { + int x; + int y [[clang::requires_explicit_initialization]]; // expected-note 2{{'y' declared here}} higher-

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

2024-09-30 Thread Helena Kotas via cfe-commits
@@ -29,19 +29,48 @@ class DirectXTargetCodeGenInfo : public TargetCodeGenInfo { llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, const Type *Ty) const { - auto *BuiltinTy = dyn_cast(Ty); - if (!BuiltinTy

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/earnol edited https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/102040 >From 7ea9d3dbb6ff74ca3f7f9b9a0c589e4a0a3366f2 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Mon, 5 Aug 2024 15:04:19 -0400 Subject: [PATCH 1/2] Add Clang attribute to ensure that fields are

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

2024-09-30 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 85181788576151cc4b52d38d9b52d04f26179530 e84c90246c4bdd1f0301ce88ac9055dfa3a9c5b0 --e

[clang] 4dfed69 - [flang][preprocessor] Don't expand INCLUDE under -E by default (#110333)

2024-09-30 Thread via cfe-commits
Author: Peter Klausler Date: 2024-09-30T12:38:47-07:00 New Revision: 4dfed691a9f846b1ff773e28b878404b78559890 URL: https://github.com/llvm/llvm-project/commit/4dfed691a9f846b1ff773e28b878404b78559890 DIFF: https://github.com/llvm/llvm-project/commit/4dfed691a9f846b1ff773e28b878404b78559890.diff

[clang] [flang] [flang][preprocessor] Don't expand INCLUDE under -E by default (PR #110333)

2024-09-30 Thread Peter Klausler via cfe-commits
https://github.com/klausler closed https://github.com/llvm/llvm-project/pull/110333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,67 @@ +//===--- NondetermnisticPointerUsageCheck.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: Apache-2

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/whisperity converted_to_draft https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
@@ -5214,9 +5215,9 @@ unsigned RecordDecl::getODRHash() { // Only calculate hash on first call of getODRHash per record. ODRHash Hash; Hash.AddRecordDecl(this); - // For RecordDecl the ODRHash is stored in the remaining 26 - // bit of RecordDeclBits, adjust the hash to

[clang] [HLSL] Treat `main` as any other function (PR #110546)

2024-09-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. There is still logic elsewhere that sets the default entry point to "main", right? This looks right to me. https://github.com/llvm/llvm-project/pull/110546 ___ cfe-commits mailing list cfe-commits@

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-09-30 Thread Eli Friedman via cfe-commits
@@ -4207,16 +4214,31 @@ llvm::Constant *ItaniumRTTIBuilder::BuildTypeInfo( break; } - llvm::Constant *Init = llvm::ConstantStruct::getAnon(Fields); - SmallString<256> Name; llvm::raw_svector_ostream Out(Name); CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -3171,6 +3171,372 @@ void lockUnlock() EXCLUSIVE_LOCKS_REQUIRED(mu) { } // end namespace ScopedUnlock +namespace PassingScope { + +class SCOPED_LOCKABLE RelockableScope { +public: + RelockableScope(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu); + void Release() UNLOCK_FUNCTION(

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -3171,6 +3171,372 @@ void lockUnlock() EXCLUSIVE_LOCKS_REQUIRED(mu) { } // end namespace ScopedUnlock +namespace PassingScope { + +class SCOPED_LOCKABLE RelockableScope { +public: + RelockableScope(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu); + void Release() UNLOCK_FUNCTION(

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -211,17 +214,35 @@ must be held on entry to the function, *and must still be held on exit*. mu1.Unlock(); } + void require(MutexLocker& scope REQUIRES(mu1)) { +scope.Unlock(); +a=0; // Warning! Requires mu1. aaronpuchert wrote: Nitpick: sp

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -305,6 +337,16 @@ deadlock can occur if the function acquires the mutex a second time. mu.Unlock(); } + void exclude(MutexLocker& scope LOCKS_EXCLUDED(mu)){ aaronpuchert wrote: ```suggestion void exclude(MutexLocker& scope LOCKS_EXCLUDED(mu)) { `

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/110523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, } } + std::optional Args; + if (Exp) { +if (const auto *CE = dyn_cast(Exp)) + Args = CE->arguments(); +else if (const auto *CE = dyn_cast(Exp)) + Args = CE->ar

[clang] Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (PR #110523)

2024-09-30 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert commented: One more idea for a test: can a parameter attribute reference another parameter? Then we could try something like ```c++ struct ObjectWithMutex { Mutex mu; }; void releaseMember(ObjectWithMutex& object, ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCT

[clang] [Clang][TableGen] Change ClangAttrEmitter to use const Record * (PR #110584)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110584 None >From 26576dbe94bbe9885b01ca66c97f9ccbc87ec471 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:04:17 -0700 Subject: [PATCH] [Clang][TableGen] Change ClangAttrEmitter to use const Recor

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
https://github.com/higher-performance updated https://github.com/llvm/llvm-project/pull/102040 >From 7ea9d3dbb6ff74ca3f7f9b9a0c589e4a0a3366f2 Mon Sep 17 00:00:00 2001 From: higher-performance Date: Mon, 5 Aug 2024 15:04:19 -0400 Subject: [PATCH 1/2] Add Clang attribute to ensure that fields are

[clang] [clang-tools-extra] [clang-tidy] add `ctime` and `localtime` to `clang-tidy` (PR #110366)

2024-09-30 Thread Зишан Мирза via cfe-commits
https://github.com/zimirza updated https://github.com/llvm/llvm-project/pull/110366 From 4fb69942effb3cf34d07f33a14a95757b6ca5ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B8=D1=88=D0=B0=D0=BD=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0?= Date: Sat, 28 Sep 2024 17:05:42 +0200 Subjec

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-30 Thread via cfe-commits
@@ -268,6 +268,69 @@ static void CheckStringInit(Expr *Str, QualType &DeclT, const ArrayType *AT, updateStringLiteralType(Str, DeclT); } +template +std::enable_if_t()( + std::declval()))>, + size_t> +forEachFieldRecursive(const RecordDec

[clang] [clang-tools-extra] [clang-tidy] add `ctime` and `localtime` to `clang-tidy` (PR #110366)

2024-09-30 Thread Зишан Мирза via cfe-commits
https://github.com/zimirza updated https://github.com/llvm/llvm-project/pull/110366 From 4fb69942effb3cf34d07f33a14a95757b6ca5ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B8=D1=88=D0=B0=D0=BD=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0?= Date: Sat, 28 Sep 2024 17:05:42 +0200 Subjec

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Itanium Mangle] Enable mangling of enclosing class for member… (PR #110503)

2024-09-30 Thread Richard Smith via cfe-commits
@@ -693,7 +693,7 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const Decl *D) { if (VD->isExternC()) return getASTContext().getTranslationUnitDecl(); - if (const auto *FD = D->getAsFunction()) { + if (const auto *FD = dyn_cast(D)) { zygoloi

[clang] [clang-tools-extra] [clang-tidy] add `ctime` and `localtime` to `clang-tidy` (PR #110366)

2024-09-30 Thread Зишан Мирза via cfe-commits
https://github.com/zimirza updated https://github.com/llvm/llvm-project/pull/110366 From 4fb69942effb3cf34d07f33a14a95757b6ca5ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B8=D1=88=D0=B0=D0=BD=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0?= Date: Sat, 28 Sep 2024 17:05:42 +0200 Subjec

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

2024-09-30 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/110327 >From 4f235c0e9c539cdaa2bab9a7f8228f33c0fea2b8 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 26 Sep 2024 14:34:16 -0700 Subject: [PATCH 1/3] Add codegen for existing resource types and make HLSLAttribut

[clang] [llvm] workflows/release-binaries: Use static ZSTD on macOS (PR #109909)

2024-09-30 Thread Keith Smiley via cfe-commits
keith wrote: It looks like at least 1 issue was that CMAKE_SYSTEM_NAME isn't set at the time this configuration is loaded, I swapped it to use the host system name, which is imperfect, but probably fine. Lets see if that works https://github.com/llvm/llvm-project/pull/109909 __

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== whisperity wrote: ```suggestion bugprone-nondeterministic-pointer-usage === ```

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,1450 @@ +// Like the compiler, clang-tidy treats some functions differently if +// they come from a system header -- for example, it is assumed that system +// functions do not arbitrarily free() their parameters, and that some bugs +// found in system headers cannot be

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,31 @@ +.. title:: clang-tidy - bugprone-nondeterministic-pointer-usage + +nondeterministic-pointer-usage +== + +Finds nondeterministic usages of pointers in unordered containers. + +One canonical example is iteration across a container of poi

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -179,6 +180,8 @@ class BugproneModule : public ClangTidyModule { CheckFactories.registerCheck( "bugprone-narrowing-conversions"); CheckFactories.registerCheck("bugprone-no-escape"); +CheckFactories.registerCheck( +"bugprone-nondeterministic-pointe

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
@@ -0,0 +1,69 @@ +// RUN: %check_clang_tidy %s bugprone-nondeterministic-pointer-usage %t -- -- -I%S -std=c++!4 + +#include "Inputs/system-header-simulator-cxx.h" + +template +void f(T x); + +void PointerIteration() { + int a = 1, b = 2; + std::set OrderedIntSet = {a, b}; + st

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/whisperity requested changes to this pull request. (Also, for reference, I dug out the original CSA checkers' initial reviews from the history: https://reviews.llvm.org/D50488 and https://reviews.llvm.org/D59279.) Even though the removed checks are alpha, maybe their removal

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Nondeterministic pointer usage improvements (PR #110471)

2024-09-30 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 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 78ccffc05336201c90e2c0bb2ae929ea3a6eec2b 6dd203077d78ea7d757ab775a0a61b365c3359b8 --e

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/110581 BEXTR/TZCNT are already handled, so we just need to tag the rest of the intrinsics, which are all expanded to generic patterns. >From 6dd203077d78ea7d757ab775a0a61b365c3359b8 Mon Sep 17 00:00:00 2001 From: Simo

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Simon Pilgrim (RKSimon) Changes BEXTR/TZCNT are already handled, so we just need to tag the rest of the intrinsics, which are all expanded to generic patterns. --- Full diff: https://github.com/llvm/llvm-project/pull/110581.diff 3

[clang] [clang] Redeclare function templates instances per primary template (PR #110387)

2024-09-30 Thread Matheus Izvekov via cfe-commits
@@ -2146,9 +2147,15 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( FunctionDecl *SpecFunc = FunctionTemplate->findSpecialization(Innermost, InsertPos); -// If we already have a function template specialization, return it. -if (SpecFunc) - return S

[clang] [llvm] [sanitizer] Document AddressSanitizer security considerations (PR #100937)

2024-09-30 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. LGTM % vitaly's comment https://github.com/llvm/llvm-project/pull/100937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][x86] Add constexpr support for all remaining BMI1 intrinsics (PR #110581)

2024-09-30 Thread via cfe-commits
goldsteinn wrote: LG but in official headers need to fix fmt. https://github.com/llvm/llvm-project/pull/110581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Emit improved memory effects and return status for AsmStmt (PR #110510)

2024-09-30 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The gcc documentation isn't really written like a reference... it's hard to tell what exactly it does and does not guarantee. And we generally want clang to reduce its reliance on gcc documentation to define its own behavior. Particularly for edges that gcc documentation

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -114,27 +134,42 @@ struct llvm::TimeTraceProfiler { llvm::get_thread_name(ThreadName); } - TimeTraceProfilerEntry *begin(std::string Name, -llvm::function_ref Detail, -bool AsyncEvent = false) { -Sta

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -145,27 +180,32 @@ struct llvm::TimeTraceProfiler { DurationType Duration = E.End - E.Start; // Only include sections longer or equal to TimeTraceGranularity msec. -if (duration_cast(Duration).count() >= TimeTraceGranularity) +if (duration_cast(Duration).cou

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -194,13 +234,17 @@ struct llvm::TimeTraceProfiler { J.attribute("pid", Pid); J.attribute("tid", int64_t(Tid)); J.attribute("ts", StartUs); -if (E.AsyncEvent) { +if (TimeTraceEventType::AsyncEvent == E.EventType) { usx9

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. Thanks. Looks great now. Should be ready to land. Left some nit comments. https://github.com/llvm/llvm-project/pull/103039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

2024-09-30 Thread Utkarsh Saxena via cfe-commits
@@ -83,6 +83,19 @@ namespace llvm { class raw_pwrite_stream; +// Type of the time trace event. +enum class TimeTraceEventType { + // Complete events have a duration (start and end time points) and are marked + // by the "X" phase type. + CompleteEvent, usx

[clang] [Clang][TableGen] Change ClangDiagnosticEmutter to use const Record * (PR #110585)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110585 None >From a4aac38b8ce3f8e6a4f16790bc5d231a4e1635a0 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:15:06 -0700 Subject: [PATCH] [Clang][TableGen] Change ClangDiagnosticEmutter to use const

[clang] [Clang][TableGen] Change Opcodes Emitter to use const Record * (PR #110588)

2024-09-30 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/110588 None >From 46ab6ac668a50ebe46cb2a69ead5d3808250e26e Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Mon, 30 Sep 2024 15:23:11 -0700 Subject: [PATCH] [Clang][TableGen] Change Opcodes Emitter to use const Record

[clang] [llvm] Added instant events and marking defered templated instantiation. (PR #103039)

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

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat updated https://github.com/llvm/llvm-project/pull/106914 >From be771da74a7663d56cdf850c10b4daa47c087bcc Mon Sep 17 00:00:00 2001 From: Brandon Wu Date: Sun, 1 Sep 2024 09:35:34 -0700 Subject: [PATCH 1/2] [RISCV][VCIX] Precommit test --- llvm/test/CodeGen/RISCV/inlin

[clang] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

2024-09-30 Thread Florian Albrechtskirchinger via cfe-commits
@@ -27,3 +25,12 @@ int main() { } #endif + +namespace GH99036 { + +template +concept C; // expected-error {{expected '='}} +// expected-note@32 {{declared here}} falbrechtskirchinger wrote: Should have used `@-1` here. https://github.com/llvm/llvm-project/p

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat updated https://github.com/llvm/llvm-project/pull/106914 >From aff3876f0d983413d5538929e11885111079e566 Mon Sep 17 00:00:00 2001 From: Brandon Wu Date: Sun, 1 Sep 2024 09:35:34 -0700 Subject: [PATCH] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set R

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-30 Thread Brandon Wu via cfe-commits
https://github.com/4vtomat closed https://github.com/llvm/llvm-project/pull/106914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 23c0850 - [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (#106914)

2024-09-30 Thread via cfe-commits
Author: Brandon Wu Date: 2024-09-30T23:52:35-07:00 New Revision: 23c0850d2e860c5773da6e4ee4ecf9802ba62202 URL: https://github.com/llvm/llvm-project/commit/23c0850d2e860c5773da6e4ee4ecf9802ba62202 DIFF: https://github.com/llvm/llvm-project/commit/23c0850d2e860c5773da6e4ee4ecf9802ba62202.diff LO

<    1   2   3   4   5   6