[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-09 Thread Fangrui Song via cfe-commits
MaskRay wrote: Add the test to `clang/test/CodeGen/catch-undef-behavior.c` ca810073b3e4cef8ed58c03dcc724771f8f8615b ``` + /// Casting to void * or char * drops the alignment requirement. + memcpy((void *)p, (char *)q, sz); ``` https://github.com/llvm/llvm-project/pull/67766

[clang-tools-extra] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/68510 >From 466b612ff055ff7497c9473b38b90bc849370b21 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 8 Oct 2023 16:00:29 +0800 Subject: [PATCH] [clang][analysis]Use dyn_cast_or_null instead cast to prevent crash

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/67766 >From ca810073b3e4cef8ed58c03dcc724771f8f8615b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 28 Sep 2023 15:22:38 -0700 Subject: [PATCH] -fsanitize=alignment: check memcpy/memmove arguments The

[clang-tools-extra] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/68510 >From 38cf358039d81fb3703885db082b64e11760c5fc Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 8 Oct 2023 16:00:29 +0800 Subject: [PATCH] [clang][analysis]Use dyn_cast_or_null instead cast to prevent crash

[clang-tools-extra] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, When release notes could be nice (clang-tools-extra/doc/ReleaseNotest.rst) with something like: `Improved bugprone-unchecked-optional-acces check to not crash during handling of optional values` or `to not crash i certain

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/67766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/67766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/68510 >From 7a8c515c70bb06ae886c8c434d9d3a79a152d115 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 8 Oct 2023 16:00:29 +0800 Subject: [PATCH] [clang][analysis]Use dyn_cast_or_null instead cast to prevent crash

[clang-tools-extra] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-10-09 Thread Qiu Chaofan via cfe-commits
@@ -8177,6 +8177,64 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node, return SDValue(); } +SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N, ecnelises wrote: Can MIR be valid input for legalizers? I see MIR outputs are all legalized.

[clang] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-10-09 Thread Qiu Chaofan via cfe-commits
@@ -8177,6 +8177,64 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node, return SDValue(); } +SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N, ecnelises wrote: Can MIR be valid input for legalizers? I see MIR outputs are all legalized.

[clang-tools-extra] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-10-09 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises updated https://github.com/llvm/llvm-project/pull/67301 >From 92abb76631594dfc2ca586c46c38031610be0548 Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Mon, 25 Sep 2023 17:08:59 +0800 Subject: [PATCH 1/2] [Legalizer] Expand fmaximum and fminimum According to

[clang] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-10-09 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises updated https://github.com/llvm/llvm-project/pull/67301 >From 92abb76631594dfc2ca586c46c38031610be0548 Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Mon, 25 Sep 2023 17:08:59 +0800 Subject: [PATCH 1/2] [Legalizer] Expand fmaximum and fminimum According to

[clang] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
@@ -599,7 +599,7 @@ void transferAssignment(const CXXOperatorCallExpr *E, BoolValue , LatticeTransferState ) { assert(E->getNumArgs() > 0); - if (auto *Loc = cast( + if (auto *Loc = dyn_cast_or_null( jcsxky wrote: updated

[clang] [clang][dataflow]Use cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky edited https://github.com/llvm/llvm-project/pull/68510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/68510 >From 3978a4322ed7f82b52a1978debe8108f00f18acc Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 8 Oct 2023 16:00:29 +0800 Subject: [PATCH] [clang][analysis]Use dyn_cast_or_null instead cast to prevent crash

[clang-tools-extra] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > please update release note also Although `bugprone-unchecked-optional-access` is used to test this issue, root cause is in `FlowSensitiveAnalysis`. So, I am confused about which file should be updated about release not. Look forward to your suggestion! Thank you.

[clang-tools-extra] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Congcong Cai via cfe-commits
@@ -599,7 +599,7 @@ void transferAssignment(const CXXOperatorCallExpr *E, BoolValue , LatticeTransferState ) { assert(E->getNumArgs() > 0); - if (auto *Loc = cast( + if (auto *Loc = dyn_cast_or_null( HerrCai0907 wrote: If

[clang] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: please update release note also https://github.com/llvm/llvm-project/pull/68510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, just fill out the description with some more details so folks reading git log will have more context, https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list

[PATCH] D148474: [Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision

2023-10-09 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148474/new/ https://reviews.llvm.org/D148474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D158069: [clang][Interp] Fix getIndex() for composite array elements

2023-10-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 557656. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158069/new/ https://reviews.llvm.org/D158069 Files: clang/lib/AST/Interp/Context.h clang/lib/AST/Interp/Pointer.h clang/unittests/AST/CMakeLists.txt

[clang] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > The fix looks great to me! On the other hand, we usually try to add a > regression test for each of the fixes. Any chance you could get a minimal > reproducer from the codebase you are looking at? Thanks for your suggestion! Test case has been added to reproduce this issue.

[PATCH] D86310: [X86] Align i128 to 16 bytes in x86 datalayouts

2023-10-09 Thread Trevor Gross via Phabricator via cfe-commits
tmgross accepted this revision. tmgross added a comment. Tested that this patch applied on top of `main` fixes all i128 ABI issues among gcc, clang, and rustc. Probably would be good to add https://bugs.llvm.org/show_bug.cgi?id=50198 to the test suite if it isn't there already. Thanks for

[clang] [PowerPC] Fix use of FPSCR builtins in smmintrin.h (PR #67299)

2023-10-09 Thread Qiu Chaofan via cfe-commits
@@ -219,9 +234,14 @@ extern __inline __m128 */ __asm__("" : : "wa"(__r)); /* Restore enabled exceptions. */ -__fpscr_save.__fr = __builtin_mffsl(); +#ifdef _ARCH_PWR9 +__fpscr_save.__fr = __builtin_ppc_mffsl(); +#else +__fpscr_save.__fr =

[clang] [PowerPC] Fix use of FPSCR builtins in smmintrin.h (PR #67299)

2023-10-09 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises updated https://github.com/llvm/llvm-project/pull/67299 >From 2d628587b9cede36e7a93ecb1414cc0c16596934 Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Mon, 25 Sep 2023 17:06:26 +0800 Subject: [PATCH 1/2] [PowerPC] Fix use of FPSCR builtins in smmintrin.h

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-09 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/67766 >From 24d675673844f22e8aef8dc183874696216abb1d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 28 Sep 2023 15:22:38 -0700 Subject: [PATCH 1/2] -fsanitize=alignment: check memcpy/memmove arguments Similar

[clang-tools-extra] [clang][dataflow]Use dyn_cast_or_null instead cast to prevent crash (PR #68510)

2023-10-09 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/68510 >From 2de967931684cf792a7fc4708c18b867b47a9b3d Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 8 Oct 2023 16:00:29 +0800 Subject: [PATCH] [clang][analysis]Use dyn_cast_or_null instead cast to prevent crash

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Christian Kissig via cfe-commits
https://github.com/christiankissig updated https://github.com/llvm/llvm-project/pull/67788 >From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001 From: Christian Kissig Date: Tue, 26 Sep 2023 12:18:59 + Subject: [PATCH 1/6] [Support] Add KnownBits::computeForSubBorrow *

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Christian Kissig via cfe-commits
https://github.com/christiankissig updated https://github.com/llvm/llvm-project/pull/67788 >From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001 From: Christian Kissig Date: Tue, 26 Sep 2023 12:18:59 + Subject: [PATCH 1/6] [Support] Add KnownBits::computeForSubBorrow *

[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-09 Thread Fangcao Wang via cfe-commits
https://github.com/LittleMeepo created https://github.com/llvm/llvm-project/pull/68657 None >From 490145aaa74fc936682344162ba1340b65c2bebc Mon Sep 17 00:00:00 2001 From: wangfc Date: Tue, 10 Oct 2023 11:06:11 +0800 Subject: [PATCH] [flang][driver] Mark -fcommon and -mtune as visible in Flang

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Christian Kissig via cfe-commits
https://github.com/christiankissig updated https://github.com/llvm/llvm-project/pull/67788 >From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001 From: Christian Kissig Date: Tue, 26 Sep 2023 12:18:59 + Subject: [PATCH 1/5] [Support] Add KnownBits::computeForSubBorrow *

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Christian Kissig via cfe-commits
https://github.com/christiankissig updated https://github.com/llvm/llvm-project/pull/67788 >From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001 From: Christian Kissig Date: Tue, 26 Sep 2023 12:18:59 + Subject: [PATCH 1/5] [Support] Add KnownBits::computeForSubBorrow *

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Denali Lumma via cfe-commits
dlumma wrote: It seems like this PR is ready to land. Any reason why it has not been integrated @christiankissig ? https://github.com/llvm/llvm-project/pull/67788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-09 Thread Denali Lumma via cfe-commits
dlumma wrote: It seems like this PR is ready to land. Any reason why it has not been integrated @christiankissig ? https://github.com/llvm/llvm-project/pull/67788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][OHOS] Keep ARM ABI selection logic in sync between Clang and LLVM (PR #68656)

2023-10-09 Thread Brad Smith via cfe-commits
https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/68656 None >From d95c16f82bbdcc58c36b8191632b07b6857d7908 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 9 Oct 2023 22:41:36 -0400 Subject: [PATCH] [Clang][OHOS] Keep ARM ABI selection logic in sync between Clang

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-09 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/68476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-09 Thread Chen Zheng via cfe-commits
@@ -807,7 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. chenzheng1030 wrote: This is what

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/68646 >From ffc9412252cd0e046978f183384375580bd31245 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 10 Oct 2023 07:52:06 +0800 Subject: [PATCH 1/3] [clang]Avoid diagnoise invalid consteval call for invalid

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/68646 >From ffc9412252cd0e046978f183384375580bd31245 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 10 Oct 2023 07:52:06 +0800 Subject: [PATCH 1/2] [clang]Avoid diagnoise invalid consteval call for invalid

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s + +// expected-note@+2{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'S &&' for 1st argument}} erichkeane wrote: Can you use the

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note, plus a couple nits. Otherwise LGTM! https://github.com/llvm/llvm-project/pull/68646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s + +// expected-note@+2{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'S &&' for 1st argument}} +// expected-note@+1{{candidate constructor (the

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -18406,9 +18406,10 @@ static void EvaluateAndDiagnoseImmediateInvocation( FD = Call->getConstructor(); else if (auto *Cast = dyn_cast(InnerExpr)) FD = dyn_cast_or_null(Cast->getConversionFunction()); - erichkeane wrote: Unrelated change.

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/68646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

2023-10-09 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/68501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b5dffd4 - [C++20] [Modules] Don't emit function bodies which is noinline and av… (#68501)

2023-10-09 Thread via cfe-commits
Author: Chuanqi Xu Date: 2023-10-10T09:47:13+08:00 New Revision: b5dffd4957dfb58c73e168a3d9b6967f03b23a6c URL: https://github.com/llvm/llvm-project/commit/b5dffd4957dfb58c73e168a3d9b6967f03b23a6c DIFF: https://github.com/llvm/llvm-project/commit/b5dffd4957dfb58c73e168a3d9b6967f03b23a6c.diff

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

2023-10-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Yeah, of course. https://github.com/llvm/llvm-project/pull/68501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-09 Thread Justin Bogner via cfe-commits
@@ -1950,6 +1950,10 @@ bool Lexer::LexNumericConstant(Token , const char *CurPtr) { while (isPreprocessingNumberBody(C)) { CurPtr = ConsumeChar(CurPtr, Size, Result); PrevCh = C; +if (LangOpts.HLSL && C == '.' && (*CurPtr == 'x' || *CurPtr == 'r')) { +

[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

2023-10-09 Thread Justin Bogner via cfe-commits
@@ -930,7 +930,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, // and FP constants (specifically, the 'pp-number' regex), and assumes that // the byte at "*end" is both valid and not part of the regex. Because of // this, it doesn't have to

[clang] [X86][NFC]Update test cases after D159250 (PR #68517)

2023-10-09 Thread via cfe-commits
https://github.com/XinWang10 closed https://github.com/llvm/llvm-project/pull/68517 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 057ec76 - [X86][NFC]Update test cases after D159250 (#68517)

2023-10-09 Thread via cfe-commits
Author: XinWang10 Date: 2023-10-10T09:32:32+08:00 New Revision: 057ec767add8d4030beb5b78b706dcf134269c2b URL: https://github.com/llvm/llvm-project/commit/057ec767add8d4030beb5b78b706dcf134269c2b DIFF: https://github.com/llvm/llvm-project/commit/057ec767add8d4030beb5b78b706dcf134269c2b.diff

[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

2023-10-09 Thread Hubert Tong via cfe-commits
@@ -807,7 +807,7 @@ ArrayRef PPCTargetInfo::getGCCRegAliases() const { // PPC ELFABIv2 DWARF Definitoin "Table 2.26. Mappings of Common Registers". // vs0 ~ vs31 is mapping to 32 - 63, // vs32 ~ vs63 is mapping to 77 - 108. hubert-reinterpretcast wrote: I am

[clang] [analyzer] Compute length of string literal initializers (#66990) (PR #68368)

2023-10-09 Thread via cfe-commits
@@ -97,6 +97,17 @@ void strlen_constant2(char x) { clang_analyzer_eval(strlen(a) == 3); // expected-warning{{UNKNOWN}} } +const char *const global_str_ptr = "abcd"; luamfb wrote: I've added a new test to cover this too. Since non-const pointers can be

[clang] [analyzer] Compute length of string literal initializers (#66990) (PR #68368)

2023-10-09 Thread via cfe-commits
@@ -930,9 +930,24 @@ SVal CStringChecker::getCStringLength(CheckerContext , ProgramStateRef , const StringLiteral *strLit = cast(MR)->getStringLiteral(); return svalBuilder.makeIntVal(strLit->getLength(), sizeTy); } + case MemRegion::NonParamVarRegionKind: { +

[clang] [analyzer] Compute length of string literal initializers (#66990) (PR #68368)

2023-10-09 Thread via cfe-commits
https://github.com/luamfb updated https://github.com/llvm/llvm-project/pull/68368 >From 1f0249fdb0cf7b1799eb9e532bfbb4a3ffe983b0 Mon Sep 17 00:00:00 2001 From: luamfb Date: Thu, 5 Oct 2023 21:50:10 -0300 Subject: [PATCH 1/2] [analyzer] Compute length of string literal initializers (#66990)

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread via cfe-commits
modiking wrote: > > > > > Yes there are tradeoffs to doing this purely with whole program class > > > > > hierarchy analysis vs with profiled type info, and in fact they can > > > > > be complementary. For example, the profile info can indicate what > > > > > order to do the vtable

[clang] [ELF] Making cdsort default for function reordering (PR #68638)

2023-10-09 Thread via cfe-commits
https://github.com/spupyrev updated https://github.com/llvm/llvm-project/pull/68638 >From 9ae8e860296e77dbb4f0ba4332c133827ff0dd9f Mon Sep 17 00:00:00 2001 From: spupyrev Date: Mon, 9 Oct 2023 14:11:21 -0700 Subject: [PATCH 1/3] [ELF] Making cdsort default for function reordering ---

[clang] [ELF] Making cdsort default for function reordering (PR #68638)

2023-10-09 Thread via cfe-commits
https://github.com/spupyrev updated https://github.com/llvm/llvm-project/pull/68638 >From 9ae8e860296e77dbb4f0ba4332c133827ff0dd9f Mon Sep 17 00:00:00 2001 From: spupyrev Date: Mon, 9 Oct 2023 14:11:21 -0700 Subject: [PATCH] [ELF] Making cdsort default for function reordering ---

[clang] [ELF] Making cdsort default for function reordering (PR #68638)

2023-10-09 Thread via cfe-commits
https://github.com/spupyrev updated https://github.com/llvm/llvm-project/pull/68638 >From 9ae8e860296e77dbb4f0ba4332c133827ff0dd9f Mon Sep 17 00:00:00 2001 From: spupyrev Date: Mon, 9 Oct 2023 14:11:21 -0700 Subject: [PATCH] [ELF] Making cdsort default for function reordering ---

[clang-tools-extra] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
@@ -0,0 +1,41 @@ +//===--===// +// +// 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] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
https://github.com/AntonRydahl edited https://github.com/llvm/llvm-project/pull/66968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
https://github.com/AntonRydahl edited https://github.com/llvm/llvm-project/pull/66968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
@@ -0,0 +1,87 @@ +//===--===// +// +// 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-tools-extra] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
@@ -0,0 +1,87 @@ +//===--===// +// +// 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] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread Mingming Liu via cfe-commits
minglotus-6 wrote: > > > > Yes there are tradeoffs to doing this purely with whole program class > > > > hierarchy analysis vs with profiled type info, and in fact they can be > > > > complementary. For example, the profile info can indicate what order to > > > > do the vtable comparisons

[PATCH] D86310: [X86] Align i128 to 16 bytes in x86 datalayouts

2023-10-09 Thread Eric Christopher via Phabricator via cfe-commits
echristo accepted this revision. echristo added a comment. Explicitly still ok with this as well. Thanks for continuing here. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86310/new/ https://reviews.llvm.org/D86310

[clang] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2023-10-09 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 ac0dda894231e6281e7739aa0ea01a4e9697c747 bdccf1e7858826b5f41791cd0826f9e230de9197 --

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) Changes Fixes:#68542 It is meaningless to diagnose further error for a invalid function declaration. --- Full diff: https://github.com/llvm/llvm-project/pull/68646.diff 2 Files Affected: - (modified)

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/68646 Fixes:#68542 It is meaningless to diagnose further error for a invalid function declaration. >From ffc9412252cd0e046978f183384375580bd31245 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 10 Oct 2023

[clang] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2023-10-09 Thread Jan Svoboda via cfe-commits
@@ -168,6 +170,12 @@ class DependencyScanningFilesystemSharedCache { /// The backing storage for cached contents. llvm::SpecificBumpPtrAllocator ContentsStorage; +/// Map from filenames to cached real paths. +llvm::StringMap RealPathsByFilename;

[clang] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2023-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This PR starts caching calls to `DependencyScanningWorkerFilesystem::getRealPath()` that we use whenever we canonicalize module map path. In the case of the real VFS, this functions performs an

[clang] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2023-10-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/68645 This PR starts caching calls to `DependencyScanningWorkerFilesystem::getRealPath()` that we use whenever we canonicalize module map path. In the case of the real VFS, this functions performs an expensive

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread Mingming Liu via cfe-commits
@@ -18,11 +18,16 @@ * pointers to the live data in memory. This function is probably not what you * want. Use __llvm_profile_get_size_for_buffer instead. Use this function if * your program has a custom memory layout. + * NOTE: The change of function signature requires

[clang] [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-10-09 Thread James Y Knight via cfe-commits
jyknight wrote: > This pull request implements the entirety of the now-accepted N3017 - > Preprocessor Embed. Amazing! I had started to think about looking into getting this implemented recently, so it's really nice to see an implementation uploaded now! > I have no intention of following up

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread Mingming Liu via cfe-commits
@@ -177,13 +195,22 @@ VALUE_PROF_FUNC_PARAM(uint32_t, CounterIndex, Type::getInt32Ty(Ctx)) VALUE_PROF_KIND(IPVK_IndirectCallTarget, 0, "indirect call target") /* For memory intrinsic functions size profiling. */ VALUE_PROF_KIND(IPVK_MemOPSize, 1, "memory intrinsic functions

[clang] [analyzer] Extend EnumCastOutOfRange diagnostics (PR #68191)

2023-10-09 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: Overall looks good, but I think there are no tests that would showcase what trackexpression is actually doing. https://github.com/llvm/llvm-project/pull/68191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Move alpha checker EnumCastOutOfRange to optin (PR #67157)

2023-10-09 Thread Gábor Horváth via cfe-commits
Xazax-hun wrote: How well does this check work with bitwise enums? People often write code like: ``` enum AnimalFlags { HasClaws = 1, CanFly = 2, EatsFish = 4, Endangered = 8 }; AnimalFlags operator|(AnimalFlags a, AnimalFlags b) { return static_cast(static_cast(a)

[clang] [clang][Sema] Emit more specific diagnostic for auto in lambda before C++14 (#46059) (PR #68540)

2023-10-09 Thread via cfe-commits
weltschildkroete wrote: > Thanks for this patch! Thank you for the feedback and for your patience. :-) It should be fixed now (hopefully!) https://github.com/llvm/llvm-project/pull/68540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Sema] Emit more specific diagnostic for auto in lambda before C++14 (#46059) (PR #68540)

2023-10-09 Thread via cfe-commits
https://github.com/weltschildkroete updated https://github.com/llvm/llvm-project/pull/68540 >From 7e62fe6179dc63e9930a77c6996ae651d4489aa2 Mon Sep 17 00:00:00 2001 From: Leonardo Duarte Date: Sun, 8 Oct 2023 12:59:15 +0200 Subject: [PATCH] [clang][Sema] Emit more specific diagnostic for auto

[clang] [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-10-09 Thread via cfe-commits
h-vetinari wrote: > Because I don't know of any better way to commandeer a patch in GitHub As a maintainer, you can push into this branch (unless @ThePhD unchecked the default setting when creating the PR), including forcefully. For example (you could also use the github CLI, but I'm using

[clang] [clang][ExprConst] Fix crash on uninitialized array subobject (PR #67817)

2023-10-09 Thread Takuya Shimizu via cfe-commits
hazohelet wrote: Ping https://github.com/llvm/llvm-project/pull/67817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-09 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Aiden Grossman via cfe-commits
boomanaiden154 wrote: Updated in 68281947f7df4c7325b862857fbf3ed06d711f74. https://github.com/llvm/llvm-project/pull/68636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
@@ -0,0 +1,120 @@ +//===--===// +// +// 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] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
https://github.com/AntonRydahl edited https://github.com/llvm/llvm-project/pull/66968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
@@ -0,0 +1,120 @@ +//===--===// +// +// 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-tools-extra] Adding Separate OpenMP Offloading Backend to `libcxx/include/__algorithm/pstl_backends` (PR #66968)

2023-10-09 Thread Anton Rydahl via cfe-commits
https://github.com/AntonRydahl edited https://github.com/llvm/llvm-project/pull/66968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6828194 - [Sanitizer][Docs] Reformat CMake invocation in docs

2023-10-09 Thread Aiden Grossman via cfe-commits
Author: Aiden Grossman Date: 2023-10-09T22:45:34Z New Revision: 68281947f7df4c7325b862857fbf3ed06d711f74 URL: https://github.com/llvm/llvm-project/commit/68281947f7df4c7325b862857fbf3ed06d711f74 DIFF: https://github.com/llvm/llvm-project/commit/68281947f7df4c7325b862857fbf3ed06d711f74.diff

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > Sorry. I'll wait longer to merge next time. I'll push a fixup to address the > comment. Thanks for the comment/review! No need to be sorry, it's my fault. Thanks for improving documentation. https://github.com/llvm/llvm-project/pull/68636

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Aiden Grossman via cfe-commits
boomanaiden154 wrote: Sorry. I'll wait longer to merge next time. I'll push a fixup to address the comment. Thanks for the comment/review! https://github.com/llvm/llvm-project/pull/68636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex",

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex",

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Just a nit https://github.com/llvm/llvm-project/pull/68059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add support for lambda captures (PR #68558)

2023-10-09 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. LG! https://github.com/llvm/llvm-project/pull/68558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/68059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: I am to late with comment, can you make it in the same style as https://llvm.org/docs/CMake.html One line, and with $: ``` .. code-block:: console $ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="compiler-rt" path/to/llvm/source

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Aiden Grossman via cfe-commits
https://github.com/boomanaiden154 closed https://github.com/llvm/llvm-project/pull/68636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 115b6a3 - [Sanitizer][Docs] Improve docs on building Asan (#68636)

2023-10-09 Thread via cfe-commits
Author: Aiden Grossman Date: 2023-10-09T15:13:56-07:00 New Revision: 115b6a3b17a2068a45075f6c4f3256e84305bc6c URL: https://github.com/llvm/llvm-project/commit/115b6a3b17a2068a45075f6c4f3256e84305bc6c DIFF:

[clang] [analyzer] Compute length of string literal initializers (#66990) (PR #68368)

2023-10-09 Thread Gábor Horváth via cfe-commits
@@ -97,6 +97,17 @@ void strlen_constant2(char x) { clang_analyzer_eval(strlen(a) == 3); // expected-warning{{UNKNOWN}} } +const char *const global_str_ptr = "abcd"; Xazax-hun wrote: What about a non-const global pointer? Could you add a test making sure we

[clang] [Sanitizer][Docs] Improve docs on building Asan (PR #68636)

2023-10-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/68636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   >