[clang] 06b5a7c - [clang][driver] Support `-x` for all languages in CL mode (#89772)

2024-05-23 Thread via cfe-commits
Author: huangqinjin Date: 2024-05-23T22:39:17-07:00 New Revision: 06b5a7c205cbf33d1c40efc77e0820ddd4e060fa URL: https://github.com/llvm/llvm-project/commit/06b5a7c205cbf33d1c40efc77e0820ddd4e060fa DIFF: https://github.com/llvm/llvm-project/commit/06b5a7c205cbf33d1c40efc77e0820ddd4e060fa.diff

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-05-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86265 >From 6e7b38b3e3f781e11db2fa5d552fdfb6123609df Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 22 Mar 2024 17:34:08 +0800 Subject: [PATCH 1/9] [Sema] Preserve ContainsUnexpandedParameterPack in

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91876 >From e40017a2750ee39bfd1a87b5ddea620076bc4419 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 11 May 2024 20:18:52 -0700 Subject: [PATCH 1/6] [analyzer] Allow recursive functions to be trivial. ---

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -231,6 +231,15 @@ class RefCounted { void method(); void someFunction(); int otherFunction(); + unsigned recursiveTrivialFunction(int n) { return !n ? 1 : recursiveTrivialFunction(n - 1); } + unsigned recursiveComplexFunction(int n) { return !n ? otherFunction() :

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @whentojump AFAIK, both of them missed boarding 18.1.6. I'll wait for opportunities. https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (PR #92639)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/92639 >From 5ae3b193a6ec3617c99297da5b8d276b0e5bbc01 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 18 May 2024 02:17:30 -0700 Subject: [PATCH 1/2] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField( InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER; } - if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) { + if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
@@ -425,6 +425,12 @@ Attribute Changes in Clang size_t count; }; +- The attributes ``sized_by``, ``counted_by_or_null`` and ``sized_by_or_null``` + have been added as variants on ``counted_by``, each with slightly different semantics. + ``sized_by`` takes a

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind { VALID, }; -static bool CheckCountedByAttrOnField( -Sema , FieldDecl *FD, Expr *E, -llvm::SmallVectorImpl ) { +static bool +CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E, +

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/93231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind { VALID, }; -static bool CheckCountedByAttrOnField( -Sema , FieldDecl *FD, Expr *E, -llvm::SmallVectorImpl ) { +static bool +CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E, +

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind { VALID, }; -static bool CheckCountedByAttrOnField( -Sema , FieldDecl *FD, Expr *E, -llvm::SmallVectorImpl ) { +static bool +CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E, +

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher requested changes to this pull request. Looks pretty good. I have some minor comments. https://github.com/llvm/llvm-project/pull/93231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (PR #92639)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: > (It might be a good idea to add comments to those parts of the code to make > sure the reader knows that it was intentional.) Ok, I was gonna say I'd add tests and then realized that the error message says "local variable" to both static local as well as global variables.

[clang] [llvm] [WebAssembly] Implement prototype f16x8.extract_lane instruction. (PR #93272)

2024-05-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-webassembly Author: Brendan Dahl (brendandahl) Changes Specified at: https://github.com/WebAssembly/half-precision/blob/29a9b9462c9285d4ccc1a5dc39214ddfd1892658/proposals/half-precision/Overview.md Note: the current

[clang] [llvm] [WebAssembly] Implement prototype f16x8.extract_lane instruction. (PR #93272)

2024-05-23 Thread Brendan Dahl via cfe-commits
https://github.com/brendandahl created https://github.com/llvm/llvm-project/pull/93272 Specified at: https://github.com/WebAssembly/half-precision/blob/29a9b9462c9285d4ccc1a5dc39214ddfd1892658/proposals/half-precision/Overview.md Note: the current spec has f16x8.extract_lane as opcode 0x124,

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM from the LoongArch side. Thanks! https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Matheus Izvekov via cfe-commits
@@ -3833,6 +3833,11 @@ def note_cannot_use_trivial_abi_reason : Note< "it is polymorphic|" "it has a base of a non-trivial class type|it has a virtual base|" "it has a __weak field|it has a field of a non-trivial class type}1">; +def warn_ppc_musttail_maybe_ignored:

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread Wentao Zhang via cfe-commits
whentojump wrote: Thanks everyone! I notice that #87000 has been tagged with release milestone. I can handle the backport there. Maybe in a few days? Or sooner if that's needed. https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -7518,6 +7523,154 @@ static Attr *getCCTypeAttr(ASTContext , ParsedAttr ) { llvm_unreachable("unexpected attribute kind!"); } +std::optional +Sema::ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName) { + auto BadExpr = [&]() { +

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -4780,42 +4781,38 @@ struct FunctionEffectWithCondition { /// Return a textual description of the effect, and its condition, if any. std::string description() const; - - friend bool operator<(const FunctionEffectWithCondition , -const

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
@@ -4640,6 +4647,306 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +/// Represents an abstract function effect, using just an enumeration

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-23 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. A few more minor things, but I think this should mostly be done after this. https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) <<

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) <<

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) <<

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1426,12 +1428,9 @@ class AnnotatingParser { // the colon are passed as macro arguments. Tok->setType(TT_ObjCMethodExpr); } else if (Contexts.back().ContextKind == tok::l_paren && - !Line.InPragmaDirective) { -if

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) <<

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-05-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: This missed adding support to StructuralValue template arguments to the template differ. See https://github.com/llvm/llvm-project/pull/93265 Te support is still missing, we are just avoiding the crash for now. https://github.com/llvm/llvm-project/pull/78041

[clang] [Coroutines] Allow [[clang::coro_wrapper]] for class (PR #93268)

2024-05-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Chuanqi Xu (ChuanqiXu9) Changes Previously we allow `[[clang::coro_wrapper]]` to be marked with function to allow it to not be checked by `[[clang::coro_return_type]]`. But in our internal practice, there are classes can be return

[clang] [Coroutines] Allow [[clang::coro_wrapper]] for class (PR #93268)

2024-05-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/93268 Previously we allow `[[clang::coro_wrapper]]` to be marked with function to allow it to not be checked by `[[clang::coro_return_type]]`. But in our internal practice, there are classes can be return type of

[clang] [llvm] [WebAssembly] Implement prototype f16x8.splat instruction. (PR #93228)

2024-05-23 Thread Heejin Ahn via cfe-commits
aheejin wrote: I guess you've likely already found it but anyway it's here: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access It's basically "Email Chris". https://github.com/llvm/llvm-project/pull/93228 ___ cfe-commits mailing list

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] f9e9e59 - [Coverage][Expansion] handle nested macros in scratch space (#89869)

2024-05-23 Thread via cfe-commits
Author: Wentao Zhang Date: 2024-05-24T12:06:43+09:00 New Revision: f9e9e599c0138b2403bc89934ddace0c2a8d84d6 URL: https://github.com/llvm/llvm-project/commit/f9e9e599c0138b2403bc89934ddace0c2a8d84d6 DIFF: https://github.com/llvm/llvm-project/commit/f9e9e599c0138b2403bc89934ddace0c2a8d84d6.diff

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Chen Zheng (chenzheng1030) Changes musttail does not often possible to be generated on PPC targets as when calling to a function defined in another module, PPC needs to restore the TOC pointer. To restore the TOC pointer,

[clang] [llvm] [WebAssembly] Implement prototype f16x8.splat instruction. (PR #93228)

2024-05-23 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/93228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 09c5525 - [WebAssembly] Implement prototype f16x8.splat instruction. (#93228)

2024-05-23 Thread via cfe-commits
Author: Brendan Dahl Date: 2024-05-23T20:05:22-07:00 New Revision: 09c5525610579d71f45502c304146db1d7b38107 URL: https://github.com/llvm/llvm-project/commit/09c5525610579d71f45502c304146db1d7b38107 DIFF: https://github.com/llvm/llvm-project/commit/09c5525610579d71f45502c304146db1d7b38107.diff

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/93267 musttail does not often possible to be generated on PPC targets as when calling to a function defined in another module, PPC needs to restore the TOC pointer. To restore the TOC pointer, compiler needs to

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This was not implemented in https://github.com/llvm/llvm-project/pull/78041 when StructuralValue TemplateArguments were originally added. This patch does not implement this functionality, it just falls

[clang] [clang] Avoid crash due to unimplemented StructuralValue support in the template differ (PR #93265)

2024-05-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/93265 This was not implemented in https://github.com/llvm/llvm-project/pull/78041 when StructuralValue TemplateArguments were originally added. This patch does not implement this functionality, it just falls back to

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-23 Thread Younan Zhang via cfe-commits
@@ -111,6 +111,14 @@ def warn_cxx98_compat_raw_string_literal : Warning< "raw string literals are incompatible with C++98">, InGroup, DefaultIgnore; +def warn_cxx26_compat_raw_string_literal_character_set : Warning< + "'%0'in a raw string literal delimiter is

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-23 Thread Younan Zhang via cfe-commits
@@ -111,6 +111,14 @@ def warn_cxx98_compat_raw_string_literal : Warning< "raw string literals are incompatible with C++98">, InGroup, DefaultIgnore; +def warn_cxx26_compat_raw_string_literal_character_set : Warning< + "'%0'in a raw string literal delimiter is

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [clang][driver] Support `-x` for all languages in CL mode (PR #89772)

2024-05-23 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I think we can land this given it is approved and the CI is green https://github.com/llvm/llvm-project/pull/89772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-23 Thread Amir Ayupov via cfe-commits
https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Support `-x` for all languages in CL mode (PR #89772)

2024-05-23 Thread via cfe-commits
huangqinjin wrote: > @huangqinjin Try rebasing you changes on top of latest main. Looks like > Windows CI is passing there including flang commits which are the source > files that are causing msvc to run out of heap space. Thanks for the advice. CI green now.

[clang] [llvm] Reland "[X86] Remove knl/knm specific ISAs supports (#92883)" (PR #93136)

2024-05-23 Thread Freddy Ye via cfe-commits
FreddyLeaf wrote: > Not sure - CI checks aren't running either Woops, I was thinking that is CI checks. I was just wondering for CI checks. Now it's recovered. Thanks anyway! https://github.com/llvm/llvm-project/pull/93136 ___ cfe-commits mailing

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-23 Thread Congcong Cai via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.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:

[clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-23 Thread Amir Ayupov via cfe-commits
aaupov wrote: > Could you elaborate a bit better on why do we need a deleted block to be > present in the table? My memory fails me, aren't we using the translation > table just to map samples collected on the bolted binary? Where do the > deleted blocks become a problem? > > Other than the

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
@@ -48,10 +48,13 @@ uint8x16x4_t test_vld4q_u8(const uint8_t *addr) // CHECK-LABEL: @test_vst2q_u32( // CHECK-NEXT: entry: -// CHECK-NEXT:[[VALUE_COERCE_FCA_0_0_EXTRACT:%.*]] = extractvalue [[STRUCT_UINT32X4X2_T:%.*]] [[VALUE_COERCE:%.*]], 0, 0 -// CHECK-NEXT:

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
@@ -44,20 +44,20 @@ struct S1 f1(struct S1 s1) { return s1; } // CHECK-SOFT: define{{.*}} void @_Z2f22S2(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.S2) align 8 %agg.result, [4 x i32] %s2.coerce) // CHECK-HARD: define{{.*}} arm_aapcs_vfpcc [2 x <2 x

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
@@ -46,9 +46,9 @@ int mane() { char1 f1{1}; char1 f2{1}; -// CHECK: [[TMP:%.+]] = alloca i16 efriedma-quic wrote: The revised version of casting integers is a bit more aggressive; it's hard to make it precisely match the old code while still

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
@@ -177,7 +179,12 @@ kernel void KernelTwoMember(struct StructTwoMember u) { // AMDGCN-LABEL: define{{.*}} amdgpu_kernel void @KernelLargeTwoMember // AMDGCN-SAME: (%struct.LargeStructTwoMember %[[u_coerce:.*]]) // AMDGCN: %[[u:.*]] = alloca %struct.LargeStructTwoMember,

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 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 0012b1ea84e671a9e0c9f7f2d1564315ed9cbcca 19f3b677d92ed88b825b455d738055da05f91e0d --

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/93115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix codegen of consteval functions returning an empty class, and related issues (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/93115 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix codegen of consteval functions returning an empty class. (PR #93115)

2024-05-23 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/93115 >From 19f3b677d92ed88b825b455d738055da05f91e0d Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 23 May 2024 18:38:04 -0700 Subject: [PATCH] Fix codegen of consteval functions returning an empty

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [llvm] [WebAssembly] Implement prototype f16x8.splat instruction. (PR #93228)

2024-05-23 Thread Brendan Dahl via cfe-commits
brendandahl wrote: > LGTM % `!HasHalfPrecision` thing > > By the way I guess you can try getting commit access soon? I think it is > still "Send an email to Chris" though... Done, can I get a squash and merge? I'll look into getting commit access.

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -51,92 +169,137 @@ class RefCntblBaseVirtualDtorChecker bool shouldVisitImplicitCode() const { return false; } bool VisitCXXRecordDecl(const CXXRecordDecl *RD) { -Checker->visitCXXRecordDecl(RD); +if (!RD->hasDefinition()) + return

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-05-23 Thread Dan Liew via cfe-commits
delcypher wrote: @hnrklssn #93121 has been landed. Let's hope it sticks this time 爛 https://github.com/llvm/llvm-project/pull/93231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Ryosuke Niwa via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: > If that is an issue, one way to do this "properly" would be to create a graph Note that we do have a [`CallGraph`](https://clang.llvm.org/doxygen/classclang_1_1CallGraph.html) class. The static analyzer uses it to identify top-level entry points. It

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -231,6 +231,15 @@ class RefCounted { void method(); void someFunction(); int otherFunction(); + unsigned recursiveTrivialFunction(int n) { return !n ? 1 : recursiveTrivialFunction(n - 1); } + unsigned recursiveComplexFunction(int n) { return !n ? otherFunction() :

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -231,6 +231,15 @@ class RefCounted { void method(); void someFunction(); int otherFunction(); + unsigned recursiveTrivialFunction(int n) { return !n ? 1 : recursiveTrivialFunction(n - 1); } + unsigned recursiveComplexFunction(int n) { return !n ? otherFunction() :

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-23 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/91876 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2918973 - Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (#93121)

2024-05-23 Thread via cfe-commits
Author: Dan Liew Date: 2024-05-23T18:35:24-07:00 New Revision: 29189738b832b111b905fcc037a287eeeb0aab2c URL: https://github.com/llvm/llvm-project/commit/29189738b832b111b905fcc037a287eeeb0aab2c DIFF: https://github.com/llvm/llvm-project/commit/29189738b832b111b905fcc037a287eeeb0aab2c.diff

[clang] Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (PR #93121)

2024-05-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher closed https://github.com/llvm/llvm-project/pull/93121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (PR #93121)

2024-05-23 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/93121 >From c1f0914b1f8ae8416cebdf7f0573b4ff11f6110d Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 17 May 2024 12:07:40 -0700 Subject: [PATCH] [BoundsSafety] Reland #93121 Allow 'counted_by' attribute on

[clang] Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (PR #93121)

2024-05-23 Thread Dan Liew via cfe-commits
delcypher wrote: Filed to #93263 to track the potential refactor. https://github.com/llvm/llvm-project/pull/93121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (PR #92639)

2024-05-23 Thread Artem Dergachev via cfe-commits
haoNoQ wrote: (It might be a good idea to add comments to those parts of the code to make sure the reader knows that it was intentional.) https://github.com/llvm/llvm-project/pull/92639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [alpha.webkit.UncountedLocalVarsChecker] Detect assignments to uncounted local variable and parameters. (PR #92639)

2024-05-23 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. Aha in this case LGTM! https://github.com/llvm/llvm-project/pull/92639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #92855)

2024-05-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I figured a reproducer based on your hints: ```C++ template struct A {}; template class TT> auto f(TT a) { return a; } A v1; A v2; using X = decltype(f(v1)); using Y = decltype(f(v2)); ``` Fails with: ``` t.cc:9:20: error: no matching function for call to 'f' 9 | using Y

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -51,92 +169,137 @@ class RefCntblBaseVirtualDtorChecker bool shouldVisitImplicitCode() const { return false; } bool VisitCXXRecordDecl(const CXXRecordDecl *RD) { -Checker->visitCXXRecordDecl(RD); +if (!RD->hasDefinition()) + return

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-23 Thread Artem Dergachev via cfe-commits
@@ -11,16 +11,134 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

<    1   2   3   4   5   6   7   8   9   10   >