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

2024-08-30 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted 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-30 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: @Sirraide @AaronBallman @cor3ntin In the context of avoiding

[clang] [clang][bytecode] Add InitLinkScope for temporary variables (PR #106552)

2024-08-30 Thread Timm Baeder via cfe-commits
tbaederr wrote: @AaronBallman Can you confirm whether the following behavior is correct? When a `CXXDefaultInitExpr` is the child node of an `InitListExpr`, all `CXXThisExpr` found within that `CXXDefaultInitExpr` point to the `InitListExpr` and not to the actual instance pointer of the curren

[clang-tools-extra] d68059b - [NFC] [clangd] [Modules] Change the argument type of IsModuleFileUpToDate to reference

2024-08-30 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-30T15:15:24+08:00 New Revision: d68059bcfd1cc27e378c43b1f16019c5baccb06d URL: https://github.com/llvm/llvm-project/commit/d68059bcfd1cc27e378c43b1f16019c5baccb06d DIFF: https://github.com/llvm/llvm-project/commit/d68059bcfd1cc27e378c43b1f16019c5baccb06d.diff LO

[clang] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

2024-08-30 Thread via cfe-commits
https://github.com/Zhenhang1213 created https://github.com/llvm/llvm-project/pull/106677 fix #106344 >From 3707b69ebd14be7fb8a88a5550639d1af1948ba6 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 30 Aug 2024 15:21:12 +0800 Subject: [PATCH] fix kcfi doesn't take effect when callee function has

[clang] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Austin (Zhenhang1213) Changes fix #106344 --- Full diff: https://github.com/llvm/llvm-project/pull/106677.diff 1 Files Affected: - (modified) clang/lib/CodeGen/CodeGenFunction.cpp (+5) ``dif

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

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

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-30 Thread via cfe-commits
https://github.com/cor3ntin commented: Thanks for the detailed description! I think the change makes sense, we just might need more tests and a changelog entry https://github.com/llvm/llvm-project/pull/101020 ___ cfe-commits mailing list cfe-commits@l

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-30 Thread via cfe-commits
@@ -151,4 +152,25 @@ namespace SearchClassBetweenTemplateParameterLists { void A::B::k(V) { // expected-error {{does not match}} BB bb; // expected-error {{incomplete type}} } + + int CC; + template struct C; +#if __cplusplus >= 202003L + template struct D; + temp

[clang] [Clang][Parser] Fix name lookup of template parameters for out-of-line specializations (PR #101020)

2024-08-30 Thread via cfe-commits
cor3ntin wrote: I am sorry this fell off my radar. Feel free to ping weekly in the future https://github.com/llvm/llvm-project/pull/101020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [Clang][NFC] Consolidate tests for default argument substitution (PR #105617)

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

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

2024-08-30 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: (This is just a quick drive-by correction of the `CallDescription` matching modes. Other parts of the commit seem to be good, but I don't have a firm opinion.) https://github.com/llvm/llvm-project/pull/106581 _

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

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

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

2024-08-30 Thread Donát Nagy via cfe-commits
@@ -158,12 +160,16 @@ class CStringChecker : public Checker< eval::Call, &CStringChecker::evalStrlcpy}, {{CDM::CLibraryMaybeHardened, {"strcat"}, 2}, &CStringChecker::evalStrcat}, + {{CDM::CLibraryMaybeHardened, {"lstrcat"}, 2}, NagyDon

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

2024-08-30 Thread Donát Nagy via cfe-commits
@@ -150,6 +150,8 @@ class CStringChecker : public Checker< eval::Call, // FIXME: C23 introduces 'memset_explicit', maybe also model that {{CDM::CLibraryMaybeHardened, {"strcpy"}, 2}, &CStringChecker::evalStrcpy}, + {{CDM::CLibraryMaybeHardened, {"lstrcpy

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

2024-08-30 Thread Donát Nagy via cfe-commits
@@ -158,12 +160,16 @@ class CStringChecker : public Checker< eval::Call, &CStringChecker::evalStrlcpy}, {{CDM::CLibraryMaybeHardened, {"strcat"}, 2}, &CStringChecker::evalStrcat}, + {{CDM::CLibraryMaybeHardened, {"lstrcat"}, 2}, + &CStringChecker:

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

2024-08-30 Thread Budimir Aranđelović via cfe-commits
budimirarandjelovichtec wrote: > Can you explain what changes were made to address the various issues which > caused the earlier revert? I've tried diffing the PRs to see what the changes > are, but my git-fu is insufficient to the task. :-D I made changes in several places. Here are major cha

[clang] [clang-tools-extra] Add function check for windows platform (PR #106581)

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

[clang] [RISCV][NFC] Reimplementation of target attribute override mechanism (PR #106680)

2024-08-30 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/106680 This patch aims to replace the target attribute override mechanism based on `__RISCV_TargetAttrNeedOverride` with the insertion of several negative target features When the target attribute uses the full architect

[clang] [RISCV][NFC] Reimplementation of target attribute override mechanism (PR #106680)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Piyou Chen (BeMg) Changes This patch aims to replace the target attribute override mechanism based on `__RISCV_TargetAttrNeedOverride` with the insertion of several negative target features When the target attribute uses the full archite

[clang] e0fa2f1 - `__noop` not marked as constexpr #102064 (#105983)

2024-08-30 Thread via cfe-commits
Author: ofAlpaca Date: 2024-08-30T09:52:24+02:00 New Revision: e0fa2f1c2957d9783d21460febf103cecac9e19a URL: https://github.com/llvm/llvm-project/commit/e0fa2f1c2957d9783d21460febf103cecac9e19a DIFF: https://github.com/llvm/llvm-project/commit/e0fa2f1c2957d9783d21460febf103cecac9e19a.diff LOG:

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

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

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: @ofAlpaca Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec commented: Here are major changes. https://github.com/llvm/llvm-project/pull/106649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -5506,16 +5509,13 @@ Sema::GetMissingFormatAttributes(Stmt *Body, const FunctionDecl *FDecl) { } // Get first argument index -unsigned FirstToCheck = [&]() -> unsigned { +int FirstToCheck = [&]() -> unsigned { if (!FDecl->isVariadic()) retur

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec edited https://github.com/llvm/llvm-project/pull/106649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -84,16 +81,16 @@ void f7(const char *out, ... /* args */) // #f7 { va_list args; -vscanf(out, &args[0]); // expected-warning@#f7 {{diagnostic behavior may be improved by adding the 'scanf' format attribute to the declaration of 'f7'}} - //

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -387,17 +388,6 @@ void f40(char *out, ... /* args */) // #f40 void f41(char *out, ... /* args */) // #f41 { va_list args; -char *ch; -vscanf("%s", ch); budimirarandjelovichtec wrote: Char * was passed to second parameter which accepts va_list ty

[clang] Update Catch missing format attributes (PR #106649)

2024-08-30 Thread Budimir Aranđelović via cfe-commits
@@ -5416,15 +5416,18 @@ Sema::GetMissingFormatAttributes(Stmt *Body, const FunctionDecl *FDecl) { // If child expression is function, check if it is format function. // If it is, check if parent function misses format attributes. +unsigned int ChildFunctionFormatA

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
@@ -257,7 +257,7 @@ bool RISCVTargetInfo::initFeatureMap( // If a target attribute specified a full arch string, override all the ISA // extension target features. - const auto I = llvm::find(FeaturesVec, "__RISCV_TargetAttrNeedOverride"); + const auto I = llvm::find(Fea

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From 64557cf6950c17a92b6d85980530abe1e193e111 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/3] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
@@ -2993,10 +2993,17 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) { return Diag(LiteralLoc, diag::warn_unsupported_target_attribute) << Unknown << Tune << ParsedAttrs.Tune << Target; - if (Context.getTargetInfo().getTriple().isRI

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert created https://github.com/llvm/llvm-project/pull/106681 For movname@GOTPCREL(%rip), %reg test %reg, name@GOTPCREL(%rip) binop name@GOTPCREL(%rip), %reg where binop is one of adc, add, and, cmp, or, sbb, sub, xor instructi

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert converted_to_draft https://github.com/llvm/llvm-project/pull/106681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-clang-driver Author: Shengchen Kan (KanRobert) Changes For movname@GOTPCREL(%rip), %reg test %reg, name@GOTPCREL(%rip) binop name@GOTPCREL(%rip), %reg where binop is one of adc

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-binary-utilities Author: Shengchen Kan (KanRobert) Changes For movname@GOTPCREL(%rip), %reg test %reg, name@GOTPCREL(%rip) binop name@GOTPCREL(%rip), %reg where binop is one of adc, add, and, cmp, or, sbb

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lld Author: Shengchen Kan (KanRobert) Changes For movname@GOTPCREL(%rip), %reg test %reg, name@GOTPCREL(%rip) binop name@GOTPCREL(%rip), %reg where binop is one of adc, add, and, cmp, or, sbb, sub, xor instruc

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 89e6a288674c9fae33aeb5448c7b1fe782b2bf53 8d8aea0d9d6b85a3b279a1c60b50cf9b859d6919 --e

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/106683 This is the following patch of https://github.com/llvm/llvm-project/pull/66462 to optimize its performance. # Motivation To avoid data races, we choose "per file owns its dependent modules" model. That sa

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9) Changes This is the following patch of https://github.com/llvm/llvm-project/pull/66462 to optimize its performance. # Motivation To avoid data races, we choose "per file owns its dependent modules" model.

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff d68059bcfd1cc27e378c43b1f16019c5baccb06d 1cd6f553f8c8f0f0a8dc691d3dcb413db9f4c051 --e

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/106683 >From facbe53b41f90d2b7c94d83aaaec03f83f355735 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 30 Aug 2024 15:11:07 +0800 Subject: [PATCH] [clangd] [Modules] Support Reusable Modules Builder --- clang-

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert updated https://github.com/llvm/llvm-project/pull/106681 >From 8d8aea0d9d6b85a3b279a1c60b50cf9b859d6919 Mon Sep 17 00:00:00 2001 From: Shengchen Kan Date: Tue, 25 Jun 2024 20:33:10 +0800 Subject: [PATCH 1/2] [X86,lld] Add relocation R_X86_64_REX2_GOTPCRELX For

[clang] [clang] Don't add DWARF debug info when assembling .s with clang-cl /Z7 (PR #106686)

2024-08-30 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/106686 This fixes a regression from f58330cbe44598eb2de0cca3b812f67fea0a71ca. That commit changed the clang-cl options /Zi and /Z7 to be implemented as aliases of -g rather than having separate handling. This had th

[clang] [clang] Don't add DWARF debug info when assembling .s with clang-cl /Z7 (PR #106686)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Martin Storsjö (mstorsjo) Changes This fixes a regression from f58330cbe44598eb2de0cca3b812f67fea0a71ca. That commit changed the clang-cl options /Zi and /Z7 to be implemented as aliases of -g rather than

[clang] 0722b8a - [Clang][NFC] Consolidate tests for default argument substitution (#105617)

2024-08-30 Thread via cfe-commits
Author: Younan Zhang Date: 2024-08-30T16:29:18+08:00 New Revision: 0722b8ab8168d9e1aa3413a62c65878f407225ae URL: https://github.com/llvm/llvm-project/commit/0722b8ab8168d9e1aa3413a62c65878f407225ae DIFF: https://github.com/llvm/llvm-project/commit/0722b8ab8168d9e1aa3413a62c65878f407225ae.diff

[clang] [Clang][NFC] Consolidate tests for default argument substitution (PR #105617)

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

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert updated https://github.com/llvm/llvm-project/pull/106681 >From 8d8aea0d9d6b85a3b279a1c60b50cf9b859d6919 Mon Sep 17 00:00:00 2001 From: Shengchen Kan Date: Tue, 25 Jun 2024 20:33:10 +0800 Subject: [PATCH 1/3] [X86,lld] Add relocation R_X86_64_REX2_GOTPCRELX For

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/101836 From 2e98fc222566c5e746ade4ccaba23de3b59e0a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Sat, 3 Aug 2024 18:10:34 +0200 Subject: [PATCH 1/3] [clang][ASTImporter] New fix for defaul

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-30 Thread kadir çetinkaya via cfe-commits
@@ -3286,6 +3286,14 @@ TEST_F(TokenAnnotatorTest, BlockLBrace) { EXPECT_BRACE_KIND(Tokens[4], BK_Block); EXPECT_TOKEN(Tokens[5], tok::l_brace, TT_BlockLBrace); EXPECT_BRACE_KIND(Tokens[5], BK_Block); + + Tokens = annotate("[foo bar:{{0, 1}}];", getLLVMStyle(FormatStyle::

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

2024-08-30 Thread via cfe-commits
@@ -750,8 +750,33 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (Field->hasInClassInitializer()) { if (VerifyOnly) return; - - ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); + ExprResult DIE; +

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

2024-08-30 Thread via cfe-commits
@@ -750,8 +750,33 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (Field->hasInClassInitializer()) { if (VerifyOnly) return; - - ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); + ExprResult DIE; +

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

2024-08-30 Thread via cfe-commits
@@ -750,8 +750,33 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (Field->hasInClassInitializer()) { if (VerifyOnly) return; - - ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); + ExprResult DIE; +

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

2024-08-30 Thread via cfe-commits
@@ -750,8 +750,33 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (Field->hasInClassInitializer()) { if (VerifyOnly) return; - - ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); + ExprResult DIE; +

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

2024-08-30 Thread via cfe-commits
@@ -750,8 +750,33 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (Field->hasInClassInitializer()) { if (VerifyOnly) return; - - ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); + ExprResult DIE; +

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/106241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov approved this pull request. LGMT with a small suggestion. Thanks for getting the test in! https://github.com/llvm/llvm-project/pull/106241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-30 Thread Ilya Biryukov via cfe-commits
@@ -453,6 +454,61 @@ TEST_F(SourceManagerTest, loadedSLocEntryIsInTheSameTranslationUnit) { #if defined(LLVM_ON_UNIX) +TEST_F(SourceManagerTest, ResetsIncludeLocMap) { ilya-biryukov wrote: Suggestion: add a comment explaining what this aims to test at a mor

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert updated https://github.com/llvm/llvm-project/pull/106681 >From 8d8aea0d9d6b85a3b279a1c60b50cf9b859d6919 Mon Sep 17 00:00:00 2001 From: Shengchen Kan Date: Tue, 25 Jun 2024 20:33:10 +0800 Subject: [PATCH 1/4] [X86,lld] Add relocation R_X86_64_REX2_GOTPCRELX For

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert edited https://github.com/llvm/llvm-project/pull/106681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-30 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

[clang] [analyzer] [MallocChecker] suspect all release functions as candite for supression (PR #104599)

2024-08-30 Thread Pavel Skripkin via cfe-commits
@@ -3648,35 +3648,38 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, return nullptr; } - // See if we're releasing memory while inlining a destructor - // (or one of its callees). This turns on various common - //

[clang] [analyzer] [MallocChecker] suspect all release functions as candite for supression (PR #104599)

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

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
KanRobert wrote: TODO: * [ ] Pass tests lld/test/ELF/x86-64-gotpc-relax.s and lld/test/ELF/x86-64-gotpc-relax-nopic.s https://github.com/llvm/llvm-project/pull/106681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106654 >From b71f4cf3ae2844583171cd0cc75826b8911a7b2b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 29 Aug 2024 19:27:32 -0700 Subject: [PATCH 1/2] [clang-format] Correctly annotate braces in ObjC square brackets

[clang] b294951 - [clang][bytecode] Fix the handling of address of a vector (#106558)

2024-08-30 Thread via cfe-commits
Author: yronglin Date: 2024-08-30T17:34:00+08:00 New Revision: b294951e3967730ffad14d51297694b1411d7af6 URL: https://github.com/llvm/llvm-project/commit/b294951e3967730ffad14d51297694b1411d7af6 DIFF: https://github.com/llvm/llvm-project/commit/b294951e3967730ffad14d51297694b1411d7af6.diff LOG:

[clang] [clang][bytecode] Fix the handling of address of a vector (PR #106558)

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

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

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-30 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov commented: I hope folks are ok with me chiming in as a reviewer for this. I've left quite a few comments in the RFC and is also supportive of landing this change and happy to invest into supporting it going forward inside our team. https://github.com/llvm/llvm-

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

2024-08-30 Thread Ilya Biryukov via cfe-commits
@@ -1472,3 +1472,25 @@ template struct Outer { }; }; Outer::Inner outerinner; + +void aggregate() { + struct B { +[[clang::explicit_init]] int f1; + }; + + struct S : B { // expected-warning {{uninitialized}} +int f2; +int f3 [[clang::explicit_init]]; + }; + +

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

2024-08-30 Thread Ilya Biryukov via cfe-commits
@@ -1419,6 +1419,28 @@ is not specified. }]; } +def ExplicitInitDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``clang::explicit_init`` attribute indicates that the field must be +initialized explicitly by the caller when the class is construc

[clang] Adding optin.taint.TaintedDiv checker (PR #106389)

2024-08-30 Thread Balazs Benics via cfe-commits
steakhal wrote: I had a look, and I don't think I have more to add to the existing review. https://github.com/llvm/llvm-project/pull/106389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] Adding optin.taint.TaintedDiv checker (PR #106389)

2024-08-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/106389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding optin.taint.TaintedDiv checker (PR #106389)

2024-08-30 Thread Balazs Benics via cfe-commits
@@ -1053,6 +1053,34 @@ by explicitly marking the ``size`` parameter as sanitized. See the delete[] ptr; } +.. _optin-taint-TaintedDiv: + +optin.taint.TaintedDiv (C, C++, ObjC) +" +This checker warns when the denominator in a division

[clang] Adding optin.taint.TaintedDiv checker (PR #106389)

2024-08-30 Thread Balazs Benics via cfe-commits
@@ -223,6 +223,11 @@ class CheckerManager { return static_cast(CheckerTags[tag]); } + template bool isRegisteredChecker() { +CheckerTag tag = getTag(); +return (CheckerTags.count(tag) != 0); + } steakhal wrote: ```suggestion template bool

[clang] Adding optin.taint.TaintedDiv checker (PR #106389)

2024-08-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Ah it didn't publish my inline comments. Here they are. https://github.com/llvm/llvm-project/pull/106389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [llvm] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

2024-08-30 Thread via cfe-commits
https://github.com/Zhenhang1213 updated https://github.com/llvm/llvm-project/pull/106677 >From ed682daff12596b12d03e5d0342d0514e29e9896 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 30 Aug 2024 15:21:12 +0800 Subject: [PATCH] fix kcfi doesn't take effect when callee function has no input pa

[clang] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

2024-08-30 Thread via cfe-commits
https://github.com/Zhenhang1213 updated https://github.com/llvm/llvm-project/pull/106677 >From 480be809832360293036b88b0fc46dad5838e88a Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 30 Aug 2024 15:21:12 +0800 Subject: [PATCH] fix kcfi doesn't take effect when callee function has no input pa

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

2024-08-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I didn't really have time to look in depth into this. To me, a switch from eval-call to post-call should be NFC for the most part. It would be nice if we could separate out that NFC part in a PR, and then deal with the breaking changes in a limited PR. Tha

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

2024-08-30 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: > To me, a switch from eval-call to post-call should be NFC for the most part. It is, but it causes `MallocChecker` to no longer look into body of the functions, because of `evalCall` semantics, which is breaking change. So I am not quite sure how to split this PR into two

[clang] [lld] [llvm] [X86, lld] Add relocation R_X86_64_REX2_GOTPCRELX (PR #106681)

2024-08-30 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert updated https://github.com/llvm/llvm-project/pull/106681 >From 8d8aea0d9d6b85a3b279a1c60b50cf9b859d6919 Mon Sep 17 00:00:00 2001 From: Shengchen Kan Date: Tue, 25 Jun 2024 20:33:10 +0800 Subject: [PATCH 1/5] [X86,lld] Add relocation R_X86_64_REX2_GOTPCRELX For

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/106241 From c8c29eae625991ee1ea7dfbfcda4a31f0b19b2e3 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 27 Aug 2024 17:56:47 +0200 Subject: [PATCH] [clang] Cleanup IncludeLocMap CompilerInstance can re-use sam

[clang] a2a93f0 - [clang] Cleanup IncludeLocMap (#106241)

2024-08-30 Thread via cfe-commits
Author: kadir çetinkaya Date: 2024-08-30T11:57:37+02:00 New Revision: a2a93f02930e20930d5ef38464ca9c99eb00ff23 URL: https://github.com/llvm/llvm-project/commit/a2a93f02930e20930d5ef38464ca9c99eb00ff23 DIFF: https://github.com/llvm/llvm-project/commit/a2a93f02930e20930d5ef38464ca9c99eb00ff23.dif

[clang] [clang] Cleanup IncludeLocMap (PR #106241)

2024-08-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/106241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] [MallocChecker] suspect all release functions as candite for supression (PR #104599)

2024-08-30 Thread Donát Nagy via cfe-commits
@@ -3648,35 +3648,38 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, return nullptr; } - // See if we're releasing memory while inlining a destructor - // (or one of its callees). This turns on various common - //

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/106706 None From 82ac332a3b94f6f753b706077b13f405ff776882 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Fri, 30 Aug 2024 12:28:02 +0200 Subject: [PATCH] [include-cleaner] Report refs for enum constants used th

[clang-tools-extra] [include-cleaner] Report refs for enum constants used through namespace aliases (PR #106706)

2024-08-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: kadir çetinkaya (kadircet) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/106706.diff 2 Files Affected: - (modified) clang-tools-extra/include-cleaner/lib/WalkAST.cpp (+2-1) - (modified) clang-tools-extra

[clang] [analyzer] [MallocChecker] suspect all release functions as candite for supression (PR #104599)

2024-08-30 Thread Pavel Skripkin via cfe-commits
@@ -3648,35 +3648,38 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, return nullptr; } - // See if we're releasing memory while inlining a destructor - // (or one of its callees). This turns on various common - //

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-08-30 Thread Balázs Kéri via cfe-commits
balazske wrote: I have tested it on some of the projects but there are not results from this checker. The detected type of bug looks unlikely so it is difficult to test the checker this way. https://github.com/llvm/llvm-project/pull/102636 ___ cfe-co

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-30 Thread via cfe-commits
kiran-isaac wrote: > What's the state of byval handling with the current version of the patch? byval arguments to a tail call are allowed as long as they are not split between register and stack, same as before. My change to this check was incorrect https://github.com/llvm/llvm-project/pull/1

[clang] Fix #104794: Fixed sret bugs with `clang::musttail` on 32 bit targets (PR #104795)

2024-08-30 Thread via cfe-commits
@@ -5085,7 +5085,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, RawAddress SRetAlloca = RawAddress::invalid(); llvm::Value *UnusedReturnSizePtr = nullptr; if (RetAI.isIndirect() || RetAI.isInAlloca() || RetAI.isCoerceAndExpand()) { -if (IsVirtu

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

2024-08-30 Thread Donát Nagy via cfe-commits
@@ -58,14 +60,14 @@ void testFreeOpNew() { void *p = operator new(0); free(p); // mismatch-warning@-1{{Memory allocated by 'operator new' should be deallocated by 'delete', not 'free()'}} -} // leak-warning{{Potential leak of memory pointed to by 'p'}} +} ---

[clang] Fix #104794: Fixed sret bugs with `clang::musttail` on 32 bit targets (PR #104795)

2024-08-30 Thread via cfe-commits
https://github.com/kiran-isaac edited https://github.com/llvm/llvm-project/pull/104795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-30 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > To me, a switch from eval-call to post-call should be NFC for the most part. Minor correction: this commit switches from post-call to eval-call, not the other way around. > It would be nice if we could separate out that NFC part in a PR, and then > deal with the breaking ch

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-30 Thread via cfe-commits
https://github.com/kiran-isaac updated https://github.com/llvm/llvm-project/pull/102896 >From eb7551e83618d8452f5dadae1be4aff8f6c9d23c Mon Sep 17 00:00:00 2001 From: Kiran Date: Thu, 8 Aug 2024 13:07:24 +0100 Subject: [PATCH 1/5] [ARM] musttail fixes Backend: - Caller and callee arguments no l

[clang] [llvm] [ARM] musttail fixes (PR #102896)

2024-08-30 Thread via cfe-commits
kiran-isaac wrote: > Please also add a testcase for something like: > > ``` > struct Large { int x[60]; }; > void f(long long a, long long b, Large c, Large d); > void g(long long a, long long b, Large c, Large d) { > [[clang::musttail]] return f(a,b,d,c); > } > ``` added this testcase (compi

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-08-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Alright, it's probably good enough. https://github.com/llvm/llvm-project/pull/102636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

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

2024-08-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,393 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c_diagnostics -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-format-attribute -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefixes=CHECK,C-CHECK +// RUN: %clang_cc1

  1   2   3   4   5   >