[clang] f1cb64b - [MC] Remove Darwin SDK/Version from ObjFileInfo (#103025)

2024-08-14 Thread via cfe-commits
Author: Alexis Engelke Date: 2024-08-14T09:24:07+02:00 New Revision: f1cb64b6f07184a3624ebb77f3f0e0bddafea1a4 URL: https://github.com/llvm/llvm-project/commit/f1cb64b6f07184a3624ebb77f3f0e0bddafea1a4 DIFF: https://github.com/llvm/llvm-project/commit/f1cb64b6f07184a3624ebb77f3f0e0bddafea1a4.diff

[clang] [llvm] [MC] Remove Darwin SDK/Version from ObjFileInfo (PR #103025)

2024-08-14 Thread Alexis Engelke via cfe-commits
https://github.com/aengelke closed https://github.com/llvm/llvm-project/pull/103025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: As a high level comment: Do we need to pass through the nuw flag, rather than deriving it from signedIndices? Basically, I think that we should be emitting nuw if and only if `-fsanitize=undefined` would perform a check for unsigned overflow for that gep, a

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/103088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-14 Thread Nikita Popov via cfe-commits
@@ -4345,8 +4355,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, QualType ptrType = E->getBase()->getType(); Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(), !getLangOpts().isSignedOverflowDe

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/103709 These two extensions add addtional instructions for carryless multiplication with 32-bits elements and Vector-Scalar GCM instructions. Please see https://github.com/riscv/riscv-isa-manual/pull/1306. >From 0b

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Pengcheng Wang (wangpc-pp) Changes These two extensions add addtional instructions for carryless multiplication with 32-bits elements and Vector-Scalar GCM instructions. Please see https://github.com/riscv/riscv-isa-manual/pull/13

[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-14 Thread via cfe-commits
https://github.com/Gitspike updated https://github.com/llvm/llvm-project/pull/102152 >From 869b955eb55bc53e445a8809b56c702d7c312b46 Mon Sep 17 00:00:00 2001 From: hehouhua Date: Wed, 7 Aug 2024 11:55:30 +0800 Subject: [PATCH 1/2] [clang][ASTMatcher] Add matches for StringLiteral which matches

[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-14 Thread via cfe-commits
@@ -125,6 +125,7 @@ RegistryMaps::RegistryMaps() { REGISTER_MATCHER_OVERLOAD(equals); REGISTER_REGEX_MATCHER(isExpansionInFileMatching); + REGISTER_REGEX_MATCHER(matchesString); REGISTER_REGEX_MATCHER(matchesName); REGISTER_REGEX_MATCHER(matchesSelector); --

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag created https://github.com/llvm/llvm-project/pull/103714 If pointer is passed as input operand for inline assembly, it's possible that asm block will change memory behind this pointer. So if pointer is passed inside inline asm block, it's better to not guess and assu

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Pavel Skripkin (pskrgag) Changes If pointer is passed as input operand for inline assembly, it's possible that asm block will change memory behind this pointer. So if pointer is passed inside inline asm block, it's better to not guess and

[clang] 13008aa - [clang][Interp] Diagnose pointer subtraction on zero-size arrays (#103015)

2024-08-14 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-14T10:05:06+02:00 New Revision: 13008aa45d406a65ee7adfc7672a038e4def1ad3 URL: https://github.com/llvm/llvm-project/commit/13008aa45d406a65ee7adfc7672a038e4def1ad3 DIFF: https://github.com/llvm/llvm-project/commit/13008aa45d406a65ee7adfc7672a038e4def1ad3.diff L

[clang] [clang][Interp] Diagnose pointer subtraction on zero-size arrays (PR #103015)

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

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

2024-08-14 Thread Mikael Holmén via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected mikaelholmen wrote: Hi @bob80905 I think this "-emit-llvm -disable-llvm

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Yingwei Zheng via cfe-commits
@@ -302,6 +302,9 @@ The primary goal of experimental support is to assist in the process of ratifica ``experimental-zicfilp``, ``experimental-zicfiss`` LLVM implements the `1.0 release specification `__. +``experimental

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Yingwei Zheng via cfe-commits
@@ -150,6 +150,14 @@ let Predicates = [HasStdExtZvkg], RVVConstraint = NoConstraint in { SchedBinaryMC<"WriteVGMULV", "ReadVGMULV", "ReadVGMULV">; } // Predicates = [HasStdExtZvkg] +let Predicates = [HasStdExtZvkgs], RVVConstraint = NoConstraint in {

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-14 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/103716 With this patch, clang now automatically adds ``[[clang::lifetimebound]]`` to the parameters of `std::span, std::string_view` constructors, this enables Clang to capture more cases where the returned reference o

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes With this patch, clang now automatically adds ``[[clang::lifetimebound]]`` to the parameters of `std::span, std::string_view` constructors, this enables Clang to capture more cases where the returned reference

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -497,6 +497,16 @@ template <> struct MappingTraits { } }; +template <> struct ScalarEnumerationTraits { + static void enumeration(IO &IO, FormatStyle::ReflowCommentsStyle &Value) { +IO.enumCase(Value, "Never", FormatStyle::RCS_Never); +IO.enumCase(Value, "Indent

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -3750,24 +3750,43 @@ struct FormatStyle { ReferenceAlignmentStyle ReferenceAlignment; // clang-format off - /// If ``true``, clang-format will attempt to re-flow comments. That is it - /// will touch a comment and *reflow* long comments into new lines, trying to - //

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -4588,11 +4588,11 @@ bool UnwrappedLineParser::isOnNewLine(const FormatToken &FormatTok) { // Checks if \p FormatTok is a line comment that continues the line comment // section on \p Line. -static bool -continuesLineCommentSection(const FormatToken &FormatTok, -

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -4588,11 +4588,11 @@ bool UnwrappedLineParser::isOnNewLine(const FormatToken &FormatTok) { // Checks if \p FormatTok is a line comment that continues the line comment // section on \p Line. -static bool -continuesLineCommentSection(const FormatToken &FormatTok, -

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -855,7 +859,8 @@ bool BreakableBlockComment::mayReflow( StringRef IndentContent = Content[LineIndex]; if (Lines[LineIndex].ltrim(Blanks).starts_with("*")) IndentContent = Lines[LineIndex].ltrim(Blanks).substr(1); - return LineIndex > 0 && !CommentPragmasRegex.match(

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -420,8 +420,10 @@ BreakableComment::getSplit(unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, unsigned ContentStartColumn, const llvm::Regex &CommentPragmasRegex) const { // Don't break lines matching the

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -493,9 +493,36 @@ TEST_F(FormatTestComments, AlignsBlockComments) { TEST_F(FormatTestComments, CommentReflowingCanBeTurnedOff) { FormatStyle Style = getLLVMStyleWithColumns(20); - Style.ReflowComments = false; - verifyFormat("// a aa aa", Style);

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -1160,7 +1165,8 @@ bool BreakableLineCommentSection::mayReflow( // // text that protrudes // //into text with different indent // We do reflow in that case in block comments. - return LineIndex > 0 && !CommentPragmasRegex.match(IndentContent) && + return LineInde

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -608,8 +610,10 @@ BreakableToken::Split BreakableBlockComment::getSplit( unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, unsigned ContentStartColumn, const llvm::Regex &CommentPragmasRegex) const { // Don't break lines matching the comment pragmas r

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -4778,8 +4778,8 @@ void UnwrappedLineParser::distributeComments( if (HasTrailAlignedWithNextToken && i == StartOfTrailAlignedWithNextToken) { FormatTok->ContinuesLineCommentSection = false; } else { - FormatTok->ContinuesLineCommentSection = - co

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -3750,24 +3750,43 @@ struct FormatStyle { ReferenceAlignmentStyle ReferenceAlignment; // clang-format off - /// If ``true``, clang-format will attempt to re-flow comments. That is it - /// will touch a comment and *reflow* long comments into new lines, trying to - //

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -493,9 +493,36 @@ TEST_F(FormatTestComments, AlignsBlockComments) { TEST_F(FormatTestComments, CommentReflowingCanBeTurnedOff) { FormatStyle Style = getLLVMStyleWithColumns(20); - Style.ReflowComments = false; - verifyFormat("// a aa aa", Style);

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-14 Thread Owen Pan via cfe-commits
@@ -4704,8 +4704,8 @@ void UnwrappedLineParser::flushComments(bool NewlineBeforeNext) { // // FIXME: Consider putting separate line comment sections as children to the // unwrapped line instead. -Tok->ContinuesLineCommentSection = -continuesLineComment

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Pengcheng Wang via cfe-commits
@@ -302,6 +302,9 @@ The primary goal of experimental support is to assist in the process of ratifica ``experimental-zicfilp``, ``experimental-zicfiss`` LLVM implements the `1.0 release specification `__. +``experimental

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Pengcheng Wang via cfe-commits
@@ -150,6 +150,14 @@ let Predicates = [HasStdExtZvkg], RVVConstraint = NoConstraint in { SchedBinaryMC<"WriteVGMULV", "ReadVGMULV", "ReadVGMULV">; } // Predicates = [HasStdExtZvkg] +let Predicates = [HasStdExtZvkgs], RVVConstraint = NoConstraint in {

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1039,10 +1039,6 @@ def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; -def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, NagyDonat wrote: Is it possible to write a "t

[clang] [clang][AArch64] Point the nofp ABI check diagnostics at the callee (PR #103392)

2024-08-14 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/103392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Merge lambdas from Sema to imported one (PR #103036)

2024-08-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/103036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] Compute inherited availability information (PR #103040)

2024-08-14 Thread Daniel Grumberg via cfe-commits
daniel-grumberg wrote: > > Additionally this computes availability information for all platforms ahead > > Can you add a test for this? The behavior is not exposed yet so I can't add a test, will do when I start exposing the behavior. https://github.com/llvm/llvm-project/pull/103040 _

[clang] [clang][ExtractAPI] Compute inherited availability information (PR #103040)

2024-08-14 Thread Daniel Grumberg via cfe-commits
@@ -0,0 +1,149 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing -triple arm64-apple-macosx \ +// RUN: -x objective-c-header %s -o %t/output.symbols.json -verify + + +// RUN: FileCheck %s --input-file %t/output.symbols.json

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

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

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
@@ -17509,8 +17528,17 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, if (TheDeclarator.isInvalidType()) return nullptr; - if (DiagnoseUnexpandedParameterPack(Loc, TSI, UPPC_FriendDeclaration)) + // If '...' is present, the type must contain an unexpa

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin commented: Can you make a separate pr to update the unrelated changes to cxx_status? I think we are pretty close to be able to land this https://github.com/llvm/llvm-project/pull/101448 ___ cfe-commits mailing list cfe-commi

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
@@ -17556,11 +17584,12 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, Decl *D; if (!TempParams.empty()) +// TODO: Support variadic friend template decls? cor3ntin wrote: Can we create an issue for that? https://github.com/llvm/llvm

[clang] c4206f1 - [RISCV][compiler-rt] Update __init_riscv_feature_bits prototype (#101472)

2024-08-14 Thread via cfe-commits
Author: Piyou Chen Date: 2024-08-14T17:30:53+08:00 New Revision: c4206f1ff1d946c495b74738eba9303dafb17e18 URL: https://github.com/llvm/llvm-project/commit/c4206f1ff1d946c495b74738eba9303dafb17e18 DIFF: https://github.com/llvm/llvm-project/commit/c4206f1ff1d946c495b74738eba9303dafb17e18.diff LO

[clang] [compiler-rt] [RISCV][compiler-rt] Update __init_riscv_feature_bits prototype (PR #101472)

2024-08-14 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/101472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] Compute inherited availability information (PR #103040)

2024-08-14 Thread Daniel Grumberg via cfe-commits
@@ -16,33 +16,101 @@ #include "clang/AST/Decl.h" #include "clang/Basic/TargetInfo.h" -namespace clang { +namespace { + +struct AvailabilitySet { + llvm::SmallVector Availabilities; + bool UnconditionallyDeprecated = false; + bool UnconditionallyUnavailable = false; -Avail

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-14 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/102299 >From 75306bd83eb43d0606630f9f059fc04ad1b20b06 Mon Sep 17 00:00:00 2001 From: Michelle C Djunaidi Date: Wed, 7 Aug 2024 13:10:02 +0800 Subject: [PATCH 1/8] [clang-tidy] Add bugprone-public-enable-share

[clang] [clang][ExtractAPI] Compute inherited availability information (PR #103040)

2024-08-14 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg updated https://github.com/llvm/llvm-project/pull/103040 >From cd38c476336ea90e4d080638d028dda203b52ac4 Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Tue, 13 Aug 2024 11:30:18 +0100 Subject: [PATCH 1/5] [clang][ExtractAPI] Compute inherited availability

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-14 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/102299 >From 75306bd83eb43d0606630f9f059fc04ad1b20b06 Mon Sep 17 00:00:00 2001 From: Michelle C Djunaidi Date: Wed, 7 Aug 2024 13:10:02 +0800 Subject: [PATCH 1/9] [clang-tidy] Add bugprone-public-enable-share

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-14 Thread via cfe-commits
https://github.com/MichelleCDjunaidi updated https://github.com/llvm/llvm-project/pull/102299 >From 75306bd83eb43d0606630f9f059fc04ad1b20b06 Mon Sep 17 00:00:00 2001 From: Michelle C Djunaidi Date: Wed, 7 Aug 2024 13:10:02 +0800 Subject: [PATCH 01/10] [clang-tidy] Add bugprone-public-enable-sh

[clang] [Clang][Sema] fix noexecpt mismatch of friend declaration (PR #102267)

2024-08-14 Thread Qizhi Hu via cfe-commits
jcsxky wrote: @sdkrystian Could you please take another look at this patch? The approach does what you said before. When checking exception specific equivalence of the two functions, we do instantiation and substitute all the template parameters with instantiated ones. But we can't find them

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/102831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: Just small things from me, looking good otherwise https://github.com/llvm/llvm-project/pull/102831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
@@ -39,14 +39,22 @@ AST_MATCHER(Stmt, isNULLMacroExpansion) { } StringRef getZeroLiteralToCompareWithForType(CastKind CastExprKind, - QualType Type, - ASTContext &Context) { +

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
@@ -108,6 +108,10 @@ Changes in existing checks ` check to remove `->`, when reduntant `get()` is removed. +- Added option `UseUpperCaseSuffix` to :doc:`readablility-implicit-bool-conversion + ` check specify the + case of the explicit literal 5chmidti

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
@@ -36,6 +36,7 @@ class ImplicitBoolConversionCheck : public ClangTidyCheck { const bool AllowIntegerConditions; const bool AllowPointerConditions; + const bool UseUpperCaseSuffix; 5chmidti wrote: `UseUpperCaseLiteralSuffix` ? https://github.com/llvm/ll

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
@@ -133,3 +133,18 @@ Options When `true`, the check will allow conditional pointer conversions. Default is `false`. + +.. option:: UseUpperCaseSuffix + + When `true`, the check will allow new explicit conversion use an uppercase + suffix when it applies. ---

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
@@ -873,30 +877,17 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); - // - function effects --- + /// All functions/lambdas/blocks which have bodies and which ha

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread via cfe-commits
@@ -36,6 +36,7 @@ class ImplicitBoolConversionCheck : public ClangTidyCheck { const bool AllowIntegerConditions; const bool AllowPointerConditions; + const bool UseUpperCaseSuffix; Da-Viper wrote: Will this also apply to the option passed into clang-tidy

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Julian Schmidt via cfe-commits
@@ -36,6 +36,7 @@ class ImplicitBoolConversionCheck : public ClangTidyCheck { const bool AllowIntegerConditions; const bool AllowPointerConditions; + const bool UseUpperCaseSuffix; 5chmidti wrote: Yes, the comment is in regard to the option name. My rati

[clang] [clang-repl] Fix PCH with delayed template parsing (PR #103028)

2024-08-14 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: > > BTW, the delayed template parsing is a deprecated technique. Both clang and > > MSVC won't enable this after C++20 and we think it is the root of many bugs. > > I agree. It was needed in the past to parse the MSVC stdlib, let's check if > we still need it: > [root-project/ro

[clang] [llvm] [clang][HLSL] Add WaveIsFirstLane() intrinsic (PR #103299)

2024-08-14 Thread Nathan Gauër via cfe-commits
Keenuts wrote: > We have this work tracked here: #99158 > > there should be some dxil specific tasks. Seems like most boxes are checked, except Sema checks: - what kind of Sema checks would be required for this one? Also, the intrinsic name in the issue is using camel case vs snake case for t

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/101807 >From 9c4e7ccf47d5ede2b6169effb2a09668f512a182 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sat, 3 Aug 2024 13:05:21 +0300 Subject: [PATCH 1/7] [clang] Implement `__builtin_is_implicit_lifetime()` Th

[clang] [llvm] [clang][HLSL] Add WaveIsFirstLane() intrinsic (PR #103299)

2024-08-14 Thread Nathan Gauër via cfe-commits
Keenuts wrote: > > We have this work tracked here: #99158 > > there should be some dxil specific tasks. > > Seems like most boxes would be checked by this PR, except Sema checks: > > * what kind of Sema checks would be required for this one? > Also, the intrinsic name in the issue is using ca

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/101807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][HLSL] Add WaveIsFirstLane() intrinsic (PR #103299)

2024-08-14 Thread Nathan Gauër via cfe-commits
Keenuts wrote: > This commits add the WaveIsFirstLane() hlsl intrinsinc. This intrinsic uses > the convergence intrinsincs for the SPIR-V backend. On the DXIL side, I'm not > sure what the strategy is so this is implemented like in DXC: a simple > builtin function. (DXC didn't used convergence

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
Sirraide wrote: > Can you make a separate pr to update the unrelated changes to cxx_status? Ah, yeah, I didn’t notice those. I’ll get those removed from this pr. https://github.com/llvm/llvm-project/pull/101448 ___ cfe-commits mailing list cfe-commits

[clang] [llvm] [clang][HLSL] Add WaveIsFirstLane() intrinsic (PR #103299)

2024-08-14 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts edited https://github.com/llvm/llvm-project/pull/103299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
@@ -17556,11 +17584,12 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, Decl *D; if (!TempParams.empty()) +// TODO: Support variadic friend template decls? Sirraide wrote: I can do that yeah. We just generally don’t support this type

[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

2024-08-14 Thread via cfe-commits
@@ -17509,8 +17528,17 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, if (TheDeclarator.isInvalidType()) return nullptr; - if (DiagnoseUnexpandedParameterPack(Loc, TSI, UPPC_FriendDeclaration)) + // If '...' is present, the type must contain an unexpa

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: A bit of nitpick, but would it make sense to have some consistency with `readability-identifier-naming`? Instead of `UseUpperCase`, I'm thinking of: `LiteralSuffixCase: LowerCase/UpperCase` Like I said, not a big deal, I'm just posting as suggestion in case you like it b

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-14 Thread via cfe-commits
@@ -873,30 +877,17 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); - // - function effects --- + /// All functions/lambdas/blocks which have bodies and which ha

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

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

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but with an additional test case to consider. https://github.com/llvm/llvm-project/pull/101807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread Aaron Ballman via cfe-commits
@@ -5637,6 +5638,38 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; case UTT_IsTriviallyEqualityComparable: return isTriviallyEqualityComparableType(Self, T, KeyLoc); + case UTT_IsImplicitLifetime: { +DiagnoseVLAInCXXTypeTrait(Self

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #102364)

2024-08-14 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > How soon after 1.86 landing do you plan to submit this? > > I was thinking as soon as it's released, I don't see a reason for waiting any > longer. The sooner we merge the sooner we can collect feedback and re-adjust > if needed. But of course it's up to the Clang owner

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #102364)

2024-08-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Code changes LGTM https://github.com/llvm/llvm-project/pull/102364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-14 Thread via cfe-commits
@@ -2503,6 +2503,28 @@ TEST_P(ASTMatchersTest, IsDelegatingConstructor) { cxxConstructorDecl(isDelegatingConstructor(), parameterCountIs(1; } +TEST_P(ASTMatchersTest, MatchesString) { + StatementMatcher Literal = stringLiteral(matchesString("foo.*")); + EXPECT_TRUE

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #102364)

2024-08-14 Thread Sam James via cfe-commits
thesamesam wrote: re boost: I was thinking the same re waiting until it's out but I didn't want to say it. Sounds good. https://github.com/llvm/llvm-project/pull/102364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/103059 From 36821708145587553f13df8648920f281b318240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 13 Aug 2024 14:50:17 +0200 Subject: [PATCH 1/2] [analyzer] Delete alpha.security.MallocOver

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1,40 +0,0 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix -verify %s -// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix,optin.portability -DPORTAB

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

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

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -1039,10 +1039,6 @@ def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; -def MallocOverflowSecurityChecker : Checker<"MallocOverflow">,

[clang] [Clang] Adjust concept definition locus (PR #103867)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/103867 Per [basic.scope], the locus of a concept is immediately after the introduction of its name. This let us provide better diagnostics for attempt to define recursive concepts. Note that recursive concepts are n

[clang] [Clang] Adjust concept definition locus (PR #103867)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes Per [basic.scope], the locus of a concept is immediately after the introduction of its name. This let us provide better diagnostics for attempt to define recursive concepts. Note that recursive concepts are no

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Looks good overall. Please compactify the tests by removing newlines that are not strictly necessary. It's a pitty that `ProgramState::invalidateRegions` accepts an `Expr` instead of a `Stmt` and then later inside it just conjures the result of the inval

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread via cfe-commits
@@ -5637,6 +5638,38 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; case UTT_IsTriviallyEqualityComparable: return isTriviallyEqualityComparableType(Self, T, KeyLoc); + case UTT_IsImplicitLifetime: { +DiagnoseVLAInCXXTypeTrait(Self

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/103714 >From e528b0ded1a9815195e33d141a9e8ce05fb26cd1 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Wed, 14 Aug 2024 10:50:24 +0300 Subject: [PATCH 1/2] clang/csa: stop reasoning about pointers passed inside inl

[clang] [llvm] [X86][MC] Remove CMPCCXADD's CondCode flavor. (PR #103898)

2024-08-14 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf created https://github.com/llvm/llvm-project/pull/103898 None >From d5275ef5e6a4e34bdae6b9b505ba1aae3a9a2363 Mon Sep 17 00:00:00 2001 From: Freddy Ye Date: Wed, 14 Aug 2024 19:45:21 +0800 Subject: [PATCH] [X86][MC] Remove CMPCCXADD's CondCode flavor. --- clang/t

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-14 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun edited https://github.com/llvm/llvm-project/pull/103716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-14 Thread Gábor Horváth via cfe-commits
@@ -216,6 +216,59 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) { inferGslPointerAttribute(Record, Record); } +void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) { + if (FD->getNumParams() == 0) +return; + + if (unsigned BuiltinID = FD->getB

[clang] [clang] Add lifetimebound attr to std::span/std::string_view constructor (PR #103716)

2024-08-14 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. Looks great, thanks! https://github.com/llvm/llvm-project/pull/103716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][MC] Remove CMPCCXADD's CondCode flavor. (PR #103898)

2024-08-14 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf edited https://github.com/llvm/llvm-project/pull/103898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][MC] Remove CMPCCXADD's CondCode flavor. (PR #103898)

2024-08-14 Thread Freddy Ye via cfe-commits
https://github.com/FreddyLeaf ready_for_review https://github.com/llvm/llvm-project/pull/103898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Thank you for review! Deleted newline and renamed `O` -> `I`. > It's a pitty that ProgramState::invalidateRegions accepts an Expr instead of > a Stmt and then later inside it just conjures the result of the invalidation > for a Stmt I saw that API, but thought there was a rea

[clang] [llvm] [X86][MC] Remove CMPCCXADD's CondCode flavor. (PR #103898)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Freddy Ye (FreddyLeaf) Changes To align with gas's latest changes. --- Patch is 105.32 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/103898.diff 11 Files Affected: - (modified) clang/

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1039,10 +1039,6 @@ def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; -def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, NagyDonat wrote: Now that I think about it, w

[clang] [Clang] Adjust concept definition locus (PR #103867)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/103867 >From 021ffdd7597c6ca480de273db5604cb482306d50 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 14 Aug 2024 12:06:03 +0200 Subject: [PATCH 1/2] [Clang] Adjust concept definition locus Per [basic.scope]

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/101807 >From 9c4e7ccf47d5ede2b6169effb2a09668f512a182 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sat, 3 Aug 2024 13:05:21 +0300 Subject: [PATCH 1/8] [clang] Implement `__builtin_is_implicit_lifetime()` Th

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

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

[clang] [clang-repl] Fix PCH with delayed template parsing (PR #103028)

2024-08-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > BTW, the delayed template parsing is a deprecated technique. Both clang > > > and MSVC won't enable this after C++20 and we think it is the root of > > > many bugs. > > > > > > I agree. It was needed in the past to parse the MSVC stdlib, let's check if > > we still ne

  1   2   3   4   5   >