[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
@@ -144,8 +144,13 @@ getQualification(ASTContext &Context, const DeclContext *DestContext, // since we stored inner-most parent first. std::string Result; llvm::raw_string_ostream OS(Result); - for (const auto *Parent : llvm::reverse(Parents)) + for (const auto *Parent

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak { return !SameFile; } -// Bail out in templated classes, as it is hard to spell the class name, -// i.e if the template parameter is unnamed. -if (MD->getParent()->isTemplated()) - return false

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/95235 >From de740c00c4cc3a9f2e8aff14cf8ebd880a240e58 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 14 Nov 2023 16:35:46 +0100 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member functions

[clang] [NFC][clang][bytecode] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang][bytecode] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread via cfe-commits
yronglin wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
@@ -5567,19 +5568,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106048 >From 7d5ae515f7727de98e7e8ce2f259e579a1f24463 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 17:31:11 +0200 Subject: [PATCH 1/2] [analyzer] Report violations of the "returns_nonnull"

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -10,3 +12,42 @@ void block_arity_mismatch() { void(^b)() = ^(int a, int b) { }; b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}} } + +int *nonnull_return_annotation_indirect() __attribute__((returns_nonnull)); +int *nonnull_retur

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
@@ -5567,19 +5568,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [clang] Compiler builtin for deduping a list of types (PR #105817)

2024-08-26 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/105817 >From 77003063912f691d246c4f94dd7a952ceace9268 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 23 Aug 2024 11:57:40 + Subject: [PATCH 1/3] [clang] Compiler builtin for deduping a list of types --- .

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Yanzuo Liu via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + const StringRef Name = II->getName(); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Oleksandr T. via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + const StringRef Name = II->getName(); + + if

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Oleksandr T. via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { a-tarasyuk wrote: @cor3ntin The [Attr.td](https://github.com/llvm/llvm-proje

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { AaronBallman wrote: > Does C has similar restrictions? No, C has no such rest

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 9eb7a15b385bff343969382c911d744ae954b7f0 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 24 Apr 2024 20:54:58 +0800 Subject: [PATCH 1/2] [Clang][Sema] Revisit the lambda within a type alias template

[clang] [NFC][clang][bytecode] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin closed https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d9e7286 - [NFC][clang][bytecode] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (#106071)

2024-08-26 Thread via cfe-commits
Author: yronglin Date: 2024-08-26T22:23:07+08:00 New Revision: d9e728601938f7d587ac580d32f042fa74041864 URL: https://github.com/llvm/llvm-project/commit/d9e728601938f7d587ac580d32f042fa74041864 DIFF: https://github.com/llvm/llvm-project/commit/d9e728601938f7d587ac580d32f042fa74041864.diff LOG:

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89934 >From 9eb7a15b385bff343969382c911d744ae954b7f0 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 24 Apr 2024 20:54:58 +0800 Subject: [PATCH 1/3] [Clang][Sema] Revisit the lambda within a type alias template

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/89934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-26 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag created https://github.com/llvm/llvm-project/pull/106081 PR refactors `MallocChecker` to not violate invariant of `BindExpr`, which should be called only during `evalCall` to avoid conflicts. To achieve this, most of `postCall` logic was moved to `evalCall` with addi

[clang] [WIP] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-26 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag converted_to_draft https://github.com/llvm/llvm-project/pull/106081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: Pavel Skripkin (pskrgag) Changes PR refactors `MallocChecker` to not violate invariant of `BindExpr`, which should be called only during `evalCall` to avoid conflicts. To achieve this, most of

[clang] [WIP] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-26 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: So I just wanted to share progress on this. I have only 2 failing tests now: ``` Clang :: Analysis/NewDelete+MismatchedDeallocator_intersections.cpp Clang :: Analysis/NewDelete-intersections.m ``` The problem with those is that now CSA reports read of undefined value obtained

[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

2024-08-26 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag edited https://github.com/llvm/llvm-project/pull/106081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,84 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.cpp - clang-tidy --===// EugeneZelenko wrote: Please make same length as closing comment. https://github.com/llvm/llvm-project/pull/106061 ___ cfe

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,84 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.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

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,30 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.h - clang-tidy -*- C++ -*-===// EugeneZelenko wrote: Length. https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-co

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,84 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.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

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

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

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I would expect these to be controlled by `-Wreserved-identifier` rather than keyword hiding (these are not keywords), probably in a new group like `-Wreserved-attribute-identifier`, WDYT? SourceGraph's backend is currently falling over, so I don't hav

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { AaronBallman wrote: What should the behavior be with `-nostdlib`? Should these

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx11 -pedantic -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx14 -pedantic -std=c++14 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx17 -pedantic -std=c++17 %s +// RUN: %clang_cc1 -

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx11 -pedantic -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx14 -pedantic -std=c++14 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx17 -pedantic -std=c++17 %s +// RUN: %clang_cc1 -

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx11 -pedantic -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx14 -pedantic -std=c++14 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx17 -pedantic -std=c++17 %s +// RUN: %clang_cc1 -

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM (for the time being, I don't think this is workable long term) https://github.com/llvm/llvm-project/pull/89934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/106054 >From 2d3b50688e7b0faea4452860cacc24a596cd685c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 26 Aug 2024 10:48:34 +0200 Subject: [PATCH 1/2] [Clang] Evaluate dependent indexes of pack indexing in a

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106048 >From 7d5ae515f7727de98e7e8ce2f259e579a1f24463 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 17:31:11 +0200 Subject: [PATCH 1/5] [analyzer] Report violations of the "returns_nonnull"

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -1,4 +1,6 @@ -// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability -Wno-deprecated-non-prototype -verify %s +// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability,debug.ExprInspection -Wno-deprecated-non-prototype -verify %s ---

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -10,3 +12,42 @@ void block_arity_mismatch() { void(^b)() = ^(int a, int b) { }; b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}} } + +int *nonnull_return_annotation_indirect() __attribute__((returns_nonnull)); +int *nonnull_retur

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
@@ -692,6 +692,14 @@ void NullabilityChecker::checkPreStmt(const ReturnStmt *S, NullConstraint Nullness = getNullConstraint(*RetSVal, State); Nullability RequiredNullability = getNullabilityAnnotation(RequiredRetType); + if (const auto *FunDecl = C.getLocationContext()->g

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto edited https://github.com/llvm/llvm-project/pull/106048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106048 >From 7d5ae515f7727de98e7e8ce2f259e579a1f24463 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 17:31:11 +0200 Subject: [PATCH 1/6] [analyzer] Report violations of the "returns_nonnull"

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: > Please update the documentation of the affected checkers (in > clang/docs/analyzer/checkers.rst) to mark that they are no longer limited to > Objective-C. Updated in 2d2ab3185a00 https://github.com/llvm/llvm-project/pull/106048 ___ cf

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,30 @@ +//===--- SuspiciousPointerArithmeticsUsingSizeofCheck.h - clang-tidy -*- C++ -*-===// whisperity wrote: This is not fixable without removing the `-*- C++ -*-` part, but that also should be there, because emacs users. https://github.com/llvm/l

[clang] [DXIL] Don't generate per-variable guards for DirectX (PR #106096)

2024-08-26 Thread Greg Roth via cfe-commits
https://github.com/pow2clk created https://github.com/llvm/llvm-project/pull/106096 Thread init guards are generated for local static variables when using the Microsoft CXX ABI. This ABI is also used for HLSL generation, but DXIL doesn't need the corresponding _Init_thread_header/footer calls

[clang] [DXIL] Don't generate per-variable guards for DirectX (PR #106096)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-directx @llvm/pr-subscribers-clang Author: Greg Roth (pow2clk) Changes Thread init guards are generated for local static variables when using the Microsoft CXX ABI. This ABI is also used for HLSL generation, but DXIL doesn't need the correspond

[clang] 5a288b9 - [Clang] Evaluate dependent indexes of pack indexing in a constant context (#106054)

2024-08-26 Thread via cfe-commits
Author: cor3ntin Date: 2024-08-26T17:50:32+02:00 New Revision: 5a288b9183ca3b7d2bad2b39670803e0ca195f09 URL: https://github.com/llvm/llvm-project/commit/5a288b9183ca3b7d2bad2b39670803e0ca195f09 DIFF: https://github.com/llvm/llvm-project/commit/5a288b9183ca3b7d2bad2b39670803e0ca195f09.diff LOG:

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/106054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] [AST] Fix MS 1920+ placeholder return type mangling for lambdas (PR #105999)

2024-08-26 Thread Max Winkler via cfe-commits
MaxEW707 wrote: > LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux` > running on `sanitizer-buildbot1` while building `clang` at step 2 "annotate". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/66/builds/3102 > Here is the relevant pie

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
https://github.com/whisperity updated https://github.com/llvm/llvm-project/pull/106061 >From 0202caa773928bfc395b850f52191ab15afe0eb4 Mon Sep 17 00:00:00 2001 From: zporky Date: Thu, 26 Oct 2023 20:40:39 +0200 Subject: [PATCH 01/11] Initial pointer arithmetics using sizeof matcher --- .../bug

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `libc-x86_64-debian-fullbuild-dbg` running on `libc-x86_64-debian-fullbuild` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/179/builds/4976 Here is the re

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Louis Dionne via cfe-commits
@@ -284,7 +284,7 @@ def sync_csv(rows: List[Tuple], from_github: List[PaperInfo]) -> List[Tuple]: results.append(gh.for_printing()) continue elif paper.status != gh.status: -print(f"We found a CSV row and a Github issue with differen

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Louis Dionne via cfe-commits
https://github.com/ldionne requested changes to this pull request. https://github.com/llvm/llvm-project/pull/105990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 1193f7d6487d2d94009f8d8d27da3907136482b9...e9ffeeaf7a0bf70c58a04315e451ba4553765586 .gith

[clang] [DXIL] Don't generate per-variable guards for DirectX (PR #106096)

2024-08-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/106096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DXIL] Don't generate per-variable guards for DirectX (PR #106096)

2024-08-26 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - -disable-llvm-passes %s | FileCheck %s + +// Verify that no per variable _Init_thread instructions are emitted for non-trivial static locals +// These would normally be emitted by the Mic

[clang] [DXIL] Don't generate per-variable guards for DirectX (PR #106096)

2024-08-26 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - -disable-llvm-passes %s | FileCheck %s + +// Verify that no per variable _Init_thread instructions are emitted for non-trivial static locals +// These would normally be emitted by the Mic

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Paul Zander via cfe-commits
@@ -284,7 +284,7 @@ def sync_csv(rows: List[Tuple], from_github: List[PaperInfo]) -> List[Tuple]: results.append(gh.for_printing()) continue elif paper.status != gh.status: -print(f"We found a CSV row and a Github issue with differen

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Paul Zander via cfe-commits
negril wrote: > This was suggested in #91856 and the suggestion there was that we need to > split it up per sub-project which is something @e-kwsm has been doing: > https://github.com/llvm/llvm-project/pulls/e-kwsm so I don't think this one > is needed. That PR is 3 months old? What are the o

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Aiden Grossman via cfe-commits
boomanaiden154 wrote: > That PR is 3 months old? What are the odds or the timeline of it getting > merged? Probably whenever the author gets back to reviewers. There might be a couple rounds of review before things get pushed through, but patches for two subprojects have landed already. The

[clang] [Clang] Assert non-null enum definition in CGDebugInfo::CreateTypeDefinition(const EnumType*) (PR #105556)

2024-08-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: What static analysis tool flagged this? Any idea why this particular null dereference, when LLVM/Clang have loads of assumed-non-null pointers that are dereferenced in a great many places? https://github.com/llvm/llvm-project/pull/105556 ___

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Paul Zander via cfe-commits
negril wrote: > > That PR is 3 months old? What are the odds or the timeline of it getting > > merged? > > Probably whenever the author gets back to reviewers. There might be a couple > rounds of review before things get pushed through, but patches for two > subprojects have landed already. >

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Sam James via cfe-commits
@@ -284,7 +284,7 @@ def sync_csv(rows: List[Tuple], from_github: List[PaperInfo]) -> List[Tuple]: results.append(gh.for_printing()) continue elif paper.status != gh.status: -print(f"We found a CSV row and a Github issue with differen

[clang] [clang][test] Rewrote test to work with lit internal shell syntax (PR #105902)

2024-08-26 Thread Paul T Robinson via cfe-commits
@@ -0,0 +1,22 @@ +import argparse pogo59 wrote: There is a lit substitution `%python` and I see a fair number of these in the lit tests. Some use inline python scripts, some have separate scripts, and a number of them have the python script directly in the test

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Sam James via cfe-commits
https://github.com/thesamesam edited https://github.com/llvm/llvm-project/pull/105990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][HLSL] Update DXIL/SPIRV hybird CodeGen tests to use temp var (PR #105930)

2024-08-26 Thread Greg Roth via cfe-commits
https://github.com/pow2clk commented: Thanks @AmrDeveloper ! Really appreciate your initiative to take this on! I think it might be helpful to use this excellent documentation resource https://github.com/llvm/llvm-project/blob/main/llvm/docs/CommandGuide/FileCheck.rst#filecheck-string-substitut

[clang] [clang][HLSL] Update DXIL/SPIRV hybird CodeGen tests to use temp var (PR #105930)

2024-08-26 Thread Greg Roth via cfe-commits
@@ -15,70 +15,70 @@ // DXIL_NATIVE_HALF: define noundef half @ // SPIR_NATIVE_HALF: define spir_func noundef half @ -// DXIL_NATIVE_HALF: %hlsl.frac = call half @llvm.dx.frac.f16( -// SPIR_NATIVE_HALF: %hlsl.frac = call half @llvm.spv.frac.f16( +// DXIL_NATIVE_HALF: %hlsl.frac

[clang] [clang][HLSL] Update DXIL/SPIRV hybird CodeGen tests to use temp var (PR #105930)

2024-08-26 Thread Greg Roth via cfe-commits
@@ -25,7 +25,7 @@ void main(unsigned GI : SV_GroupIndex) {} //CHECK-NEXT: entry: //CHECK-NEXT: call void @"?call_me_first@@YAXXZ"() //CHECK-NEXT: call void @"?then_call_me@@YAXXZ"() -//CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group() +//CHECK-NEXT: %0 =

[clang] [clang][HLSL] Update DXIL/SPIRV hybird CodeGen tests to use temp var (PR #105930)

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

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Kim Gräsman via cfe-commits
kimgr wrote: > > Is there an out-of-tree scenario where CLANG_RESOURCE_DIR needs to be > > replaced with something else at runtime, i.e. a real use-case for the > > optional CustomResourceDir optional argument I removed? > > @kimgr I have also looked for this and I haven't found an use-case wh

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Kim Gräsman via cfe-commits
kimgr wrote: > > Do we need anything more to make progress with this PR? > > @kimgr Do you have committer permission? Would you like some help to get this > merged? Oh, no, I don't, I would need someone to merge this for me. It's still pretty early in the v.20 cycle, right, so maybe this is a

[clang] [HLSL] Add __builtin_hlsl_is_scalarized_layout_compatible (PR #102227)

2024-08-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/102227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix crash in include cleaner (PR #99514)

2024-08-26 Thread Yuxuan Shui via cfe-commits
https://github.com/yshui closed https://github.com/llvm/llvm-project/pull/99514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix crash in include cleaner (PR #99514)

2024-08-26 Thread Yuxuan Shui via cfe-commits
yshui wrote: @HighCommander4 thanks for looking into this! I think this can be closed, right? https://github.com/llvm/llvm-project/pull/99514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-08-26 Thread via cfe-commits
@@ -125,6 +137,25 @@ class TypeDescriptor { return 1 << (TypeInfo >> 1); } + const char *getBitIntBitCountPointer() const { +DCHECK(isBitIntTy()); +DCHECK(isSignedBitIntTy()); +// Scan Name for zero and return the next address +const char *p = getTypeNam

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

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

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

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

[clang] [HLSL] Add __builtin_hlsl_is_scalarized_layout_compatible (PR #102227)

2024-08-26 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime` running on `omp-vega20-0` while building `clang` at step 7 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/4798 Here is the relevan

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From 2dc91ada9078e5c7344e74d5b549e896056f89ad Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/5] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Tulio Magno Quites Machado Filho via cfe-commits
tuliom wrote: Agreed. Let me merge this. https://github.com/llvm/llvm-project/pull/103388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
@@ -5805,6 +5805,37 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] 924a7d8 - Use CLANG_RESOURCE_DIR more consistently (#103388)

2024-08-26 Thread via cfe-commits
Author: Kim Gräsman Date: 2024-08-26T14:49:56-03:00 New Revision: 924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68 URL: https://github.com/llvm/llvm-project/commit/924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68 DIFF: https://github.com/llvm/llvm-project/commit/924a7d83b4287b3b85dd1ca29d2d3e1f0a10ea68.diff L

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Tulio Magno Quites Machado Filho via cfe-commits
https://github.com/tuliom closed https://github.com/llvm/llvm-project/pull/103388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
@@ -2690,6 +2690,163 @@ entry: ret double %abs } +define float @bitcast_to_float_sign_0(i32 %arg) { +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @bitcast_to_flo

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

2024-08-26 Thread Chris Warner via cfe-commits
https://github.com/cwarner-8702 updated https://github.com/llvm/llvm-project/pull/101073 >From 24f52fbfb9117a6498769cebdc7b09ecbd7e019e Mon Sep 17 00:00:00 2001 From: Chris Warner Date: Wed, 17 Jul 2024 11:22:39 -0700 Subject: [PATCH 1/4] [clang-tidy] bugprone-implicit-widening ignores unsigned

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

2024-08-26 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 2326a02357c74a1a913a3d572bf789d4d48af7f0 276e48b39864d2c91f97f501d9bc5ed59ca52ced --e

[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-08-26 Thread Justin Bogner via cfe-commits
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static bool calculateIsIntangibleType(QualType Ty) { + Ty = Ty->getCanonicalTypeUnqualified(); + if (Ty->isBuiltinType()) +return Ty->isHLSLSp

[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-08-26 Thread Justin Bogner via cfe-commits
@@ -5683,6 +5685,14 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return true; return false; } + case UTT_IsIntangibleType: +if (!T->isVoidType() && !T->isIncompleteArrayType()) + if (Self.RequireCompleteType(TInfo->getTypeLoc().getBe

[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-08-26 Thread Justin Bogner via cfe-commits
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static bool calculateIsIntangibleType(QualType Ty) { + Ty = Ty->getCanonicalTypeUnqualified(); + if (Ty->isBuiltinType()) +return Ty->isHLSLSp

[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-08-26 Thread Justin Bogner via cfe-commits
@@ -1154,3 +1156,70 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static bool calculateIsIntangibleType(QualType Ty) { + Ty = Ty->getCanonicalTypeUnqualified(); + if (Ty->isBuiltinType()) +return Ty->isHLSLSp

[clang] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

2024-08-26 Thread Justin Bogner via cfe-commits
@@ -27,7 +29,7 @@ using namespace clang; -SemaHLSL::SemaHLSL(Sema &S) : SemaBase(S) {} +SemaHLSL::SemaHLSL(Sema &S) : SemaBase(S), IsIntangibleTypeCache(8) {} bogner wrote: Why initialize the DenseMap with a specific number of buckets here? Why 8? https://g

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -369,24 +393,48 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS, const auto *ReferrerStackSpace = ReferrerMemSpace->getAs(); + if (!ReferrerStackSpace) return false; - if (ReferredMemSpace->getStackFrame() == Pop

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/105648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I read the commit once and I have a serious question about using `getOriginRegion` in the invalidation logic (see inline comment for details). Apart from that, the code LGTM (I might return later with a few additional comments from a more through review,

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -313,7 +321,8 @@ std::optional printReferrer(const MemRegion *Referrer) { if (isa(Space)) return "global"; assert(isa(Space)); -return "stack"; +// This case covers top-level and inlined analyses. +return "caller"; NagyDonat wrote:

<    1   2   3   4   5   >