[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Giulio Eulisse via cfe-commits
@@ -0,0 +1,84 @@ +//===- llvm/unittest/ADT/PagedVectorTest.cpp --===// +// +// 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] Introduce paged vector (PR #66430)

2023-09-15 Thread Giulio Eulisse via cfe-commits
https://github.com/ktf updated https://github.com/llvm/llvm-project/pull/66430 >From b952f0577dfe8112f394bd5392212f843c0cc86e Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+...@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:58:21 +0200 Subject: [PATCH 01/13] Introduce PagedVector

[clang] Fix math-errno issue (PR #66381)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam unassigned https://github.com/llvm/llvm-project/pull/66381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix math-errno issue (PR #66381)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam unassigned https://github.com/llvm/llvm-project/pull/66381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix math-errno issue (PR #66381)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam unassigned https://github.com/llvm/llvm-project/pull/66381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix math-errno issue (PR #66381)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam unassigned https://github.com/llvm/llvm-project/pull/66381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

2023-09-15 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/66495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

2023-09-15 Thread via cfe-commits
@@ -628,6 +630,12 @@ bool ByteCodeStmtGen::visitAsmStmt(const AsmStmt *S) { return this->emitInvalid(S); } +template +bool ByteCodeStmtGen::visitAttributedStmt(const AttributedStmt *S) { + // Ignore all attributes. cor3ntin wrote: At compile time, i

[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this contributions, I just have one comment so far on testing. We should make sure any new ADT is very well tested before landing it. https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits

[clang] Introduce paged vector (PR #66430)

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

[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,84 @@ +//===- llvm/unittest/ADT/PagedVectorTest.cpp --===// +// +// 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:

[PATCH] D159522: [Clang][C] Fixed a bug where we reject an _Atomic qualified integer in a switch statment

2023-09-15 Thread Guillot Tony via Phabricator via cfe-commits
to268 created this revision. to268 added a reviewer: aaron.ballman. to268 added a project: clang. Herald added a project: All. to268 requested review of this revision. Herald added a subscriber: cfe-commits. We are currently rejecting an _Atomic qualified integer in a switch statment. This fixes

[PATCH] D147844: [clang][Sema]Print diagnostic warning about precedence when integer expression is used without parentheses in an conditional operator expression

2023-09-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. FWIW: adding parentheses for expressions, such as `overflow = (4608 * 1024 * 1024) ? 4608 * 1024 * 1024 : 0;`, and `results.reason = (actions & _UA_SEARCH_PHASE) ? ... : ...`, looks unnatural and is too noisy to me. Repository: rG LLVM Github Monorepo CHANGES

[clang] [clang][deps] Load module map file from PCM (PR #66389)

2023-09-15 Thread Ben Langmuir via cfe-commits
@@ -1307,6 +1307,9 @@ void ModuleMap::setInferredModuleAllowedBy(Module *M, std::error_code ModuleMap::canonicalizeModuleMapPath(SmallVectorImpl ) { + FileManager = SourceMgr.getFileManager(); + FM.makeAbsolutePath(Path); benlangmuir wrote: Is the idea

[PATCH] D159519: [clang][AST][ASTImporter] improve AST comparasion on VarDecl & GotoStmt

2023-09-15 Thread Qizhi Hu via Phabricator via cfe-commits
jcsxky updated this revision to Diff 556861. jcsxky added a comment. update according to llvm convention. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159519/new/ https://reviews.llvm.org/D159519 Files:

[clang] [clang][deps] Load module map file from PCM (PR #66389)

2023-09-15 Thread Jan Svoboda via cfe-commits
@@ -1307,6 +1307,9 @@ void ModuleMap::setInferredModuleAllowedBy(Module *M, std::error_code ModuleMap::canonicalizeModuleMapPath(SmallVectorImpl ) { + FileManager = SourceMgr.getFileManager(); + FM.makeAbsolutePath(Path); jansvoboda11 wrote: I don't

[clang] [RISCV] Install sifive_vector.h to riscv-resource-headers (PR #66330)

2023-09-15 Thread Craig Topper via cfe-commits
@@ -623,6 +623,11 @@ install( EXCLUDE_FROM_ALL COMPONENT riscv-resource-headers) +install( topperc wrote: Aren't we also missing `sifive_files` from `add_header_target("riscv-resource-headers" "${riscv_files};${riscv_generated_files}")`? Is there any

[clang] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 1/8] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 1/8] [libc++] Prevent calling the projection more than three

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-15 Thread Tom Honermann via cfe-commits
tahonermann wrote: Hi, Scott! It's nice to see you pop up here! :) I'm a little concerned about maintenance of this documentation going forward. As you know, the Clang AST is not intended to be stable and, even though I don't expect dramatic changes to how templates are represented, it will

[clang] [RISCV] Support predefined marcro __riscv_misaligned_{fast,avoid}. (PR #65756)

2023-09-15 Thread Craig Topper via cfe-commits
@@ -1220,3 +1220,15 @@ // RUN: -march=rv64i_zve32x_zvkt1p0 -x c -E -dM %s \ // RUN: -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s // CHECK-ZVKT-EXT: __riscv_zvkt 100{{$}} + +// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \

[clang] [Inliner] Improve attribute propagation to callsites when inlining. (PR #66036)

2023-09-15 Thread via cfe-commits
goldsteinn wrote: > It occurs to me that the current return attribute propagation is currently > buggy for poison-generating attributes: https://llvm.godbolt.org/z/x8n18q9Mj > > In this case the argument to use() will now be poison as well, while before > inlining only the return value was

[clang] [Inliner] Improve attribute propagation to callsites when inlining. (PR #66036)

2023-09-15 Thread Nikita Popov via cfe-commits
nikic wrote: It occurs to me that the current return attribute propagation is currently buggy for poison-generating attributes: https://llvm.godbolt.org/z/x8n18q9Mj In this case the argument to use() will now be poison as well, while before inlining only the return value was poison. This

[clang] [clang-transformer] Allow stencils to read from system headers. (PR #66480)

2023-09-15 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/66480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-cl] Fix for __FUNCTION__ in c++. (PR #66120)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
@@ -2218,6 +2218,9 @@ printTo(raw_ostream , ArrayRef Args, const PrintingPolicy , } else { if (!FirstArg) OS << Comma; + //if (Argument.getKind() == TemplateArgument::Type) + // OS << "class "; + zahiraam wrote: TODO: if we go

[clang] [clang][Sema] Fix a bug when instantiating a lambda with requires clause (PR #65193)

2023-09-15 Thread via cfe-commits
https://github.com/0x59616e edited https://github.com/llvm/llvm-project/pull/65193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix a bug when instantiating a lambda with requires clause (PR #65193)

2023-09-15 Thread via cfe-commits
@@ -567,6 +567,58 @@ bool Sema::addInstantiatedCapturesToScope( return false; } +static void addDeclsFromParentScope(Sema , FunctionDecl *FD, +LocalInstantiationScope ) { + assert(isLambdaCallOperator(FD) && "FD must be a lambda call

[clang-tools-extra] e8b1af9 - Fix clang-tidy sphinx docs

2023-09-15 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2023-09-15T10:11:10-04:00 New Revision: e8b1af9a55764e91015a4f9bbabdb39cf95caf94 URL: https://github.com/llvm/llvm-project/commit/e8b1af9a55764e91015a4f9bbabdb39cf95caf94 DIFF: https://github.com/llvm/llvm-project/commit/e8b1af9a55764e91015a4f9bbabdb39cf95caf94.diff

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/66509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread Louis Dionne via cfe-commits
ldionne wrote: I guess I'll close this and reopen when I have something that actually works for handling trailing whitespace. https://github.com/llvm/llvm-project/pull/66509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-09-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Add some primitive syntax highlighting to our code snippet output. Before: ![Screenshot from 2023-09-15 16-00-23](https://github.com/llvm/llvm-project/assets/49720664/8e43767a-d939-4c9f-ac2d-65e2df5de1f2) After: ![Screenshot

[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

2023-09-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/66514 Add some primitive syntax highlighting to our code snippet output. Before: ![Screenshot from 2023-09-15 16-00-23](https://github.com/llvm/llvm-project/assets/49720664/8e43767a-d939-4c9f-ac2d-65e2df5de1f2)

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,312 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,312 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,312 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,312 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,312 @@ +//===- StdVariantChecker.cpp -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
@@ -0,0 +1,128 @@ +//===- TaggedUnionModeling.h -*- C++ -*-==// +// +// 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] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
https://github.com/DonatNagyE commented: Very promising checker with straightforward and clean logic! I have lots of comments, but they are all minor/cosmetic issues. https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread via cfe-commits
https://github.com/DonatNagyE edited https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix math-errno issue (PR #66381)

2023-09-15 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/66381 >From 997e3b69ac5c20a9130b957c86c08b16d23af07c Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Thu, 14 Sep 2023 06:27:35 -0700 Subject: [PATCH 1/4] Fix math-errno issue ---

[clang] [NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes (PR #66295)

2023-09-15 Thread Paul T Robinson via cfe-commits
@@ -661,27 +661,27 @@ static bool FixupInvocation(CompilerInvocation , static unsigned getOptimizationLevel(ArgList , InputKind IK, DiagnosticsEngine ) { - unsigned DefaultOpt = llvm::CodeGenOpt::None; + unsigned DefaultOpt = 0; if

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread Louis Dionne via cfe-commits
ldionne wrote: @tru Sounds good! I gave you https://github.com/llvm/llvm-project/issues/66468 too. https://github.com/llvm/llvm-project/pull/66509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread Tobias Hieta via cfe-commits
tru wrote: @ldionne thanks for the whitespace check! I have already put some work into the clang-format action on my end. Would you mind dropping it from this PR and let me push mine first? My action is not just restricted to the clang subdir. https://github.com/llvm/llvm-project/pull/66509

[clang] [analyzer] Fix StackAddrEscapeChecker crash on temporary object fields (PR #66493)

2023-09-15 Thread Balazs Benics via cfe-commits
@@ -398,7 +400,7 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS, }(Referrer->getMemorySpace()); // This cast supposed to succeed. steakhal wrote: > I think the best would be either a comment that explains _why_ we expect a >

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-github-workflow Changes Instead of using the BuildKite jobs, use GitHub actions to detect clang-format violations and trailing whitespace in PRs. Fixes #66468 -- Full diff: https://github.com/llvm/llvm-project/pull/66509.diff 6 Files

[clang] [clang] Setup whitespace detection and clang-format as Github actions (PR #66509)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/66509 Instead of using the BuildKite jobs, use GitHub actions to detect clang-format violations and trailing whitespace in PRs. Fixes #66468 >From 46330c22414ed8722e85ff349f502d4e5a1bac5d Mon Sep 17 00:00:00 2001

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
@@ -1446,6 +1446,51 @@ TEST(TransferTest, BaseClassInitializer) { llvm::Succeeded()); } +TEST(TransferTest, StructModeledFieldsWithAccessor) { + std::string Code = R"( +class S { + int *P; + int *Q; + int X; + int Y; + int Z;

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
@@ -288,6 +288,18 @@ static void insertIfFunction(const Decl , Funcs.insert(FD); } +static Expr *getRetValueFromSingleReturnStmtMethod(const CXXMemberCallExpr ) { + auto *D = cast_or_null(C.getMethodDecl()->getDefinition()); + if (!D) +return nullptr; + auto *S =

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
@@ -324,6 +336,12 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet , } else if (auto *E = dyn_cast()) { insertIfGlobal(*E->getDecl(), Vars); insertIfFunction(*E->getDecl(), Funcs); + } else if (const auto *C = dyn_cast()) { +// If this is a method that returns

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
@@ -1446,6 +1446,51 @@ TEST(TransferTest, BaseClassInitializer) { llvm::Succeeded()); } +TEST(TransferTest, StructModeledFieldsWithAccessor) { + std::string Code = R"( +class S { + int *P; + int *Q; + int X; + int Y; + int Z; +public: +

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
@@ -324,6 +336,12 @@ getFieldsGlobalsAndFuncs(const Stmt , FieldSet , } else if (auto *E = dyn_cast()) { insertIfGlobal(*E->getDecl(), Vars); insertIfFunction(*E->getDecl(), Funcs); + } else if (const auto *C = dyn_cast()) { +// If this is a method that returns

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
https://github.com/martinboehme approved this pull request. https://github.com/llvm/llvm-project/pull/66368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Model the fields that are accessed via inline accessors (PR #66368)

2023-09-15 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/66368 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66498)

2023-09-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/66498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66498)

2023-09-15 Thread Balazs Benics via cfe-commits
steakhal wrote: Pushed manually with an adjusted commit message: https://github.com/llvm/llvm-project/commit/7c9abbd8a41e85a7e82a454c62138ea72f981597 https://github.com/llvm/llvm-project/pull/66498 ___ cfe-commits mailing list

[clang] 7c9abbd - Reapply [analyzer] Simplify SVal for simple NonLoc->Loc casts

2023-09-15 Thread Balazs Benics via cfe-commits
Author: dingfei Date: 2023-09-15T15:07:39+02:00 New Revision: 7c9abbd8a41e85a7e82a454c62138ea72f981597 URL: https://github.com/llvm/llvm-project/commit/7c9abbd8a41e85a7e82a454c62138ea72f981597 DIFF: https://github.com/llvm/llvm-project/commit/7c9abbd8a41e85a7e82a454c62138ea72f981597.diff LOG:

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
danix800 wrote: `auto-merge` might be disabled probably. I can't find the button mentioned [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request).

[clang] [Driver] Link Flang runtime on Solaris (PR #65644)

2023-09-15 Thread Rainer Orth via cfe-commits
rorth wrote: I'd argue that handling the Flang runtime libs like C++ is the right thing to do here. However, `flang-new` currently rejects all of `-r`, `-nostdlib`, and `-nodefaultlibs` on both Linux and Solaris. On top of that, Solaris `clang` doesn't handle `-r` correctly, passing `-e

[clang] [RISCV] Support predefined marcro __riscv_misaligned_{fast,avoid}. (PR #65756)

2023-09-15 Thread Yeting Kuo via cfe-commits
yetingk wrote: Ping. https://github.com/llvm/llvm-project/pull/65756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]add new check `bugprone-compare-pointer-to-member-virtual-function` (PR #66055)

2023-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/66055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tidy]add new check `bugprone-compare-pointer-to-member-virtual-function` (PR #66055)

2023-09-15 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/66055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 72d4d4e - [clang-tidy]add new check `bugprone-compare-pointer-to-member-virtual-function` (#66055)

2023-09-15 Thread via cfe-commits
Author: Congcong Cai Date: 2023-09-15T20:59:12+08:00 New Revision: 72d4d4e3b9f6b54582358ac5c1006e295b9ed58e URL: https://github.com/llvm/llvm-project/commit/72d4d4e3b9f6b54582358ac5c1006e295b9ed58e DIFF: https://github.com/llvm/llvm-project/commit/72d4d4e3b9f6b54582358ac5c1006e295b9ed58e.diff

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread Gábor Spaits via cfe-commits
https://github.com/spaits updated https://github.com/llvm/llvm-project/pull/66481 From 5472e377f9a4b51a8c400f1cc1703aa83fa45d1b Mon Sep 17 00:00:00 2001 From: Gabor Spaits Date: Fri, 15 Sep 2023 10:21:30 +0200 Subject: [PATCH] [analyzer] Add std::variant checker Adding a checker that checks

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Uh, this isn't my expertiese. I'm a bit scared to do this alone. I'm also short on time to verify this patch at scale. https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-15 Thread Balazs Benics via cfe-commits
@@ -1824,6 +1835,94 @@ RangeSet SymbolicRangeInferrer::VisitBinaryOperator(Range LHS, return {RangeFactory, ValueFactory.getValue(Min), ValueFactory.getValue(Max)}; } +RangeSet SymbolicRangeInferrer::handleConcreteModulo(Range LHS, +

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-15 Thread Balazs Benics via cfe-commits
@@ -1824,6 +1835,94 @@ RangeSet SymbolicRangeInferrer::VisitBinaryOperator(Range LHS, return {RangeFactory, ValueFactory.getValue(Min), ValueFactory.getValue(Max)}; } +RangeSet SymbolicRangeInferrer::handleConcreteModulo(Range LHS, +

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -258,114 +276,71 @@ TEST(SolverTest, IffWithUnits) { } TEST(SolverTest, IffWithUnitsConflict) { - ConstraintContext Ctx; - auto X = Ctx.atom(); - auto Y = Ctx.atom(); - auto XEqY = Ctx.iff(X, Y); - auto NotY = Ctx.neg(Y); - - // (X <=> Y) ^ X !Y -

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -87,6 +87,9 @@ class alignas(const Formula *) Formula { ArrayRef Operands, unsigned Value = 0); + // Parse Formulas using Arena rather than caling this function directly. + static Formula *parse(llvm::BumpPtrAllocator ,

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -13,6 +13,7 @@ #include "llvm/Support/Allocator.h" #include "llvm/Support/ErrorHandling.h" #include +#include martinboehme wrote: Inadvertent change? (There are no other changes in this file.) https://github.com/llvm/llvm-project/pull/66424

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -87,6 +87,9 @@ class alignas(const Formula *) Formula { ArrayRef Operands, unsigned Value = 0); + // Parse Formulas using Arena rather than caling this function directly. martinboehme wrote: ```suggestion

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -137,5 +140,46 @@ TEST_F(ArenaTest, Interning) { EXPECT_EQ((), ); } +TEST_F(ArenaTest, Parse) { martinboehme wrote: ```suggestion TEST_F(ArenaTest, ParseFormula) { ``` Matches name of the function, and we might conceivably add other parsing functions

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -95,4 +98,94 @@ BoolValue ::makeBoolValue(const Formula ) { return *It->second; } +namespace { +const Formula *parse(Arena , llvm::StringRef ) { + auto EatWhitespace = [&] { In = In.ltrim(' '); }; martinboehme wrote: ```suggestion auto EatWhitespace

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
@@ -95,4 +98,94 @@ BoolValue ::makeBoolValue(const Formula ) { return *It->second; } +namespace { +const Formula *parse(Arena , llvm::StringRef ) { + auto EatWhitespace = [&] { In = In.ltrim(' '); }; + EatWhitespace(); + + if (In.consume_front("!")) { +if (auto *Arg

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
https://github.com/martinboehme approved this pull request. https://github.com/llvm/llvm-project/pull/66424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [dataflow] Parse formulas from text (PR #66424)

2023-09-15 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/66424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix StackAddrEscapeChecker crash on temporary object fields (PR #66493)

2023-09-15 Thread via cfe-commits
@@ -398,7 +400,7 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS, }(Referrer->getMemorySpace()); // This cast supposed to succeed. DonatNagyE wrote: I think the best would be either a comment that explains _why_ we expect a

[clang] [Clang][ObjC] Add optionality to property attribute strings. (PR #66507)

2023-09-15 Thread Alastair Houghton via cfe-commits
https://github.com/al45tair created https://github.com/llvm/llvm-project/pull/66507 Add a new attribute, "?", to the property attribute string for properties of protocols that are declared @optional. (Previously https://reviews.llvm.org/D135273) rdar://100463524 >From

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-15 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/66481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-transformer] Allow stencils to read from system headers. (PR #66480)

2023-09-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/66480 >From b23472e55093ea1d48d11386cc4ced43f913c170 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Fri, 15 Sep 2023 10:42:16 +0200 Subject: [PATCH] [clang-transformer] Allow stencils to read from system

[clang] [clang-transformer] Allow stencils to read from system headers. (PR #66480)

2023-09-15 Thread Clement Courbet via cfe-commits
@@ -91,6 +91,10 @@ StringRef getExtendedText(const T , tok::TokenKind Next, llvm::Error validateEditRange(const CharSourceRange , const SourceManager ); +/// Determines whether \p Range is one that can be read from. +llvm::Error

[clang] [clang-transformer] Allow stencils to read from system headers. (PR #66480)

2023-09-15 Thread Clement Courbet via cfe-commits
@@ -230,7 +230,7 @@ class SelectorStencil : public StencilInterface { // message. If it's valid, then something else is the cause and we just // return the generic failure message. if (auto Err = - tooling::validateEditRange(*RawRange,

[clang] [clang-transformer] Allow stencils to read from system headers. (PR #66480)

2023-09-15 Thread Clement Courbet via cfe-commits
https://github.com/legrosbuffle updated https://github.com/llvm/llvm-project/pull/66480 >From 312eeef4c301e1049f50436fa3aa8d070b5cb4e9 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Fri, 15 Sep 2023 10:42:16 +0200 Subject: [PATCH] [clang-transformer] Allow stencils to read from system

[clang] a20f485 - [clang-format] Generate the style options

2023-09-15 Thread via cfe-commits
Author: sstwcw Date: 2023-09-15T12:37:21Z New Revision: a20f485bb0c9af3c7a7179bd71ae910c58278341 URL: https://github.com/llvm/llvm-project/commit/a20f485bb0c9af3c7a7179bd71ae910c58278341 DIFF: https://github.com/llvm/llvm-project/commit/a20f485bb0c9af3c7a7179bd71ae910c58278341.diff LOG:

[clang] [analyzer] Fix StackAddrEscapeChecker crash on temporary object fields (PR #66493)

2023-09-15 Thread Balazs Benics via cfe-commits
@@ -398,7 +400,7 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS, }(Referrer->getMemorySpace()); // This cast supposed to succeed. steakhal wrote: I was thinking about it once you raised this comment. To me, to have a proper

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-09-15 Thread via cfe-commits
HoBoIs wrote: @zygoloid @yuanfang-chen @faisalv @OleStrohm Could you review my commit and/or suggest more appropriate reviewers? Thanks in advance! https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-09-15 Thread via cfe-commits
https://github.com/HoBoIs ready_for_review https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

2023-09-15 Thread Timm Baeder via cfe-commits
@@ -628,6 +630,12 @@ bool ByteCodeStmtGen::visitAsmStmt(const AsmStmt *S) { return this->emitInvalid(S); } +template +bool ByteCodeStmtGen::visitAttributedStmt(const AttributedStmt *S) { + // Ignore all attributes. tbaederr wrote: > Is this what we want

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Changes This is the implementation of step 3 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079. -- Full diff:

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-09-15 Thread via cfe-commits
https://github.com/HoBoIs edited https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-09-15 Thread via cfe-commits
https://github.com/HoBoIs edited https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-15 Thread Guillaume Chatelet via cfe-commits
https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/66504 This is the implementation of step 3 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079. >From

<    1   2   3   4   5   >