[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 Thread Jannick Kremer via cfe-commits
@@ -2052,6 +2052,19 @@ def referenced(self): return self._referenced +@property +def specialized(self): +""" +For a cursor that is instantiated from a template, returns a cursor +representing the template that it was instantiated from.

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum commented: The Python part looks mostly good to me. I'm not too familiar with the non-Python side of things though, so would like someone else to take a look as well. @Endilll do you want to take a look? https://github.com/llvm/llvm-project/pull/123539 _

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 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 293dbea8b0169525d93a4ee4b7d6c53aa9d4bee0 8aea4bc08a1f48819d8fa4e6608997b5f5c1d024 --e

[clang] [clang][Sema] Unwrap reference types in HeuristicResolverImpl::resolveTypeToRecordDecl() (PR #124451)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nathan Ridge (HighCommander4) Changes Partially fixes https://github.com/llvm/llvm-project/issues/124450 --- Full diff: https://github.com/llvm/llvm-project/pull/124451.diff 2 Files Affected: - (modified) clang/lib/Sema/HeuristicResolve

[clang] [clang][Sema] Unwrap reference types in HeuristicResolverImpl::resolveTypeToRecordDecl() (PR #124451)

2025-01-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/124451 Partially fixes https://github.com/llvm/llvm-project/issues/124450 >From 9c8349f994f8c66f07be79834352fbe25301ef43 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 26 Jan 2025 02:04:45 -0500 Subject

[clang] [llvm] [StrTable] Switch intrinsics to StringTable and work around MSVC (PR #123548)

2025-01-25 Thread Chandler Carruth via cfe-commits
@@ -51,28 +57,71 @@ class StringToOffsetTable { return II->second; } - // Emit the string using string literal concatenation, for better readability - // and searchability. - void EmitStringLiteralDef(raw_ostream &OS, const Twine &Decl, -co

[clang] [clang][CodeComplete] Use HeuristicResolver to resolve CXXDependentScopeMemberExpr (PR #124449)

2025-01-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/124449 None >From 6f0ff1b166f2ea3b0bfa58ca2a0911832d751bdf Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 26 Jan 2025 01:30:28 -0500 Subject: [PATCH] [clang][CodeComplete] Use HeuristicResolver to resol

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #124448)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes This patch avoids repeated map lookups and constructions of temporary std::string instances by switching to StringMap. --- Full diff: https://github.com/llvm/llvm-project/pull/124448.diff 1 Files Aff

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #124448)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124448 This patch avoids repeated map lookups and constructions of temporary std::string instances by switching to StringMap. >From 2273e9e518fa5625a40298a970dfd3ad1c3f27db Mon Sep 17 00:00:00 2001 From: Kazu H

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124447)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124447)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124447 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124446)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124446)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124446 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [llvm] [clang][docs] Fix typos concerning wasm __funcref (PR #124365)

2025-01-25 Thread Timothy Herchen via cfe-commits
https://github.com/anematode updated https://github.com/llvm/llvm-project/pull/124365 >From 2508da6fd7f38101011573460724f13df1c1616d Mon Sep 17 00:00:00 2001 From: Timothy Herchen Date: Fri, 24 Jan 2025 15:13:30 -0800 Subject: [PATCH 1/2] [clang][docs] Fix typos concerning wasm __funcref ---

[clang] [clang] disallow narrowing when matching template template parameters (PR #124313)

2025-01-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124313 >From 8210ac8a213a8409dc3b470fb295b70e8264934d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 12 Jan 2025 14:45:24 -0300 Subject: [PATCH] [clang] disallow narrowing when matching template template p

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2025-01-25 Thread Owen Pan via cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `clang` at step 6 "test-openmp". Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/12436 Here is the relevant piec

[clang] c1ec5be - [clang-format] Fix a TableGen crash on comment after l_paren (#124380)

2025-01-25 Thread via cfe-commits
Author: Owen Pan Date: 2025-01-25T18:31:42-08:00 New Revision: c1ec5beb4ab36c2c4d99ed6d735d217e74364771 URL: https://github.com/llvm/llvm-project/commit/c1ec5beb4ab36c2c4d99ed6d735d217e74364771 DIFF: https://github.com/llvm/llvm-project/commit/c1ec5beb4ab36c2c4d99ed6d735d217e74364771.diff LOG:

[clang] [clang-format] Treat `f(a)` as template function call (PR #124438)

2025-01-25 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/124438 >From 8679752fc806d232732bab5da1f53b78c6f7f0e9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 25 Jan 2025 15:53:36 -0800 Subject: [PATCH] [clang-format] Treat `f(a)` as template function call Fixes #123144.

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/124380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-25 Thread Jason Rice via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++26 %s -verify ricejasonf wrote: I added these to the bottom of this file. https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-co

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/124380 >From 5b45be664597788137686c1b374f362f23e06d78 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 24 Jan 2025 18:07:05 -0800 Subject: [PATCH 1/2] [clang-format] Fix a crash on comment after TableGen l_paren Fix

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-25 Thread via cfe-commits
antangelo wrote: > LGTM modulo nits. Can we observe that through sema/pch tests? This functionality isn't yet observable in code (i.e. through lit tests), so it can't be tested through PCH tests on its own (which is primarily why I haven't split this code off sooner). In the CTAD from inherite

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-25 Thread via cfe-commits
@@ -2290,18 +2290,21 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create( ASTContext &C, DeclContext *DC, SourceLocation StartLoc, ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstr

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-25 Thread via cfe-commits
@@ -8147,6 +8149,26 @@ TEST_P(ImportFunctions, CTADWithLocalTypedef) { ASSERT_TRUE(ToD); } +TEST_P(ImportFunctions, CTADAliasTemplate) { + Decl *TU = getTuDecl( + R"( + template struct A { +A(T); + }; + template + using B = A; + B b{(i

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-25 Thread via cfe-commits
https://github.com/antangelo updated https://github.com/llvm/llvm-project/pull/123875 >From ff55e99b39e2e60859a93db5a479ac2128761e30 Mon Sep 17 00:00:00 2001 From: antangelo Date: Tue, 21 Jan 2025 22:53:39 -0500 Subject: [PATCH 1/2] [clang] Track source deduction guide for alias template deduc

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Hirofumi Nakamura via cfe-commits
https://github.com/hnakamura5 approved this pull request. https://github.com/llvm/llvm-project/pull/124380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Hirofumi Nakamura via cfe-commits
@@ -101,6 +101,9 @@ TEST_F(FormatTestTableGen, BangOperators) { " \"zerozero\",\n" " true: // default\n" " \"positivepositive\");\n"

[clang] [clang-format] Treat `f(a)` as template function call (PR #124438)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #123144. --- Full diff: https://github.com/llvm/llvm-project/pull/124438.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+3-4) - (modified) clang/unittests/Format/TokenAnn

[clang] [clang-format] Treat `f(a)` as template function call (PR #124438)

2025-01-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/124438 Fixes #123144. >From c401d699b756a54b2e7c9a1c00bcae005c9cae4d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 25 Jan 2025 15:53:36 -0800 Subject: [PATCH] [clang-format] Treat `f(a)` as template function call

[clang] [StrTable] Mechanically convert NVPTX builtins to use TableGen (PR #122873)

2025-01-25 Thread Chandler Carruth via cfe-commits
chandlerc wrote: Ping! I've updated this to incorporate the changes in #123398 to the NVPTX.def file this is replacing. Adding the author & reviewers of that PR to this -- I'd really like to either get this landed or figure out what other approach to use it avoid having to continually update

[clang] d2c7cab - [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124434)

2025-01-25 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-01-25T15:25:17-08:00 New Revision: d2c7cabe0453d6a6d03c15b7ae1800b53de9e182 URL: https://github.com/llvm/llvm-project/commit/d2c7cabe0453d6a6d03c15b7ae1800b53de9e182 DIFF: https://github.com/llvm/llvm-project/commit/d2c7cabe0453d6a6d03c15b7ae1800b53de9e182.diff L

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124434)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/124434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124433)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/124433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0f3c288 - [AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124433)

2025-01-25 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-01-25T15:25:04-08:00 New Revision: 0f3c2884f3ccbdbe396e4388feb8be716b50dd68 URL: https://github.com/llvm/llvm-project/commit/0f3c2884f3ccbdbe396e4388feb8be716b50dd68 DIFF: https://github.com/llvm/llvm-project/commit/0f3c2884f3ccbdbe396e4388feb8be716b50dd68.diff L

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-25 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-multistage` running on `systemz-1` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/98/builds/941 Here is the relevant piece of the

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124433)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124434)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124433)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124434)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [Sema] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124434)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124434 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124433)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124433 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [clang] Implement gcc_struct attribute on Itanium targets (PR #71148)

2025-01-25 Thread Fangrui Song via cfe-commits
@@ -6113,9 +6113,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (KernelOrKext && RawTriple.isOSDarwin()) CmdArgs.push_back("-fforbid-guard-variables"); - if (Args.hasFlag(options::OPT_mms_bitfields, options::OPT_mno_ms_bitfields, -

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/124425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 04d5608 - [AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124430)

2025-01-25 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-01-25T14:05:11-08:00 New Revision: 04d5608057f73cf8deb66ddaeddf2f9254fd864b URL: https://github.com/llvm/llvm-project/commit/04d5608057f73cf8deb66ddaeddf2f9254fd864b DIFF: https://github.com/llvm/llvm-project/commit/04d5608057f73cf8deb66ddaeddf2f9254fd864b.diff L

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124430)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/124430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 563c7c5 - [clang] Migrate away from PointerUnion::dyn_cast (NFC) (#124425)

2025-01-25 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-01-25T14:05:01-08:00 New Revision: 563c7c5539f05e7f8cbb42565c1f24466019f38b URL: https://github.com/llvm/llvm-project/commit/563c7c5539f05e7f8cbb42565c1f24466019f38b DIFF: https://github.com/llvm/llvm-project/commit/563c7c5539f05e7f8cbb42565c1f24466019f38b.diff L

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, /// Retrieve the template argument list as written in the sources, /// if any. const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { -if (auto *Info = ExplicitInfo.dyn

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124430)

2025-01-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/124430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124430)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Litera

[clang] [AST] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124430)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124430 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast Literal migration

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
@@ -885,18 +885,18 @@ class Preprocessor { } ~MacroState() { - if (auto *Info = State.dyn_cast()) + if (auto *Info = dyn_cast_if_present(State)) Info->~ModuleMacroInfo(); } MacroDirective *getLatest() const { - if (auto *Info = State

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
@@ -1391,7 +1391,9 @@ class DeclContextLookupResult { const_iterator end() const { return iterator(); } bool empty() const { return Result.isNull(); } - bool isSingleResult() const { return Result.dyn_cast(); } + bool isSingleResult() const { +return dyn_cast_if_pre

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata updated https://github.com/llvm/llvm-project/pull/124425 >From 8586c0eae876176888bba3f9f9b8f2a83eea9684 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 25 Jan 2025 10:38:03 -0800 Subject: [PATCH 1/2] [clang] Migrate away from PointerUnion::dyn_cast (NFC)

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -885,18 +885,18 @@ class Preprocessor { } ~MacroState() { - if (auto *Info = State.dyn_cast()) + if (auto *Info = dyn_cast_if_present(State)) Info->~ModuleMacroInfo(); } MacroDirective *getLatest() const { - if (auto *Info = State

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, /// Retrieve the template argument list as written in the sources, /// if any. const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { -if (auto *Info = ExplicitInfo.dyn

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -1391,7 +1391,9 @@ class DeclContextLookupResult { const_iterator end() const { return iterator(); } bool empty() const { return Result.isNull(); } - bool isSingleResult() const { return Result.dyn_cast(); } + bool isSingleResult() const { +return dyn_cast_if_pre

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Nikita Popov via cfe-commits
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, /// Retrieve the template argument list as written in the sources, /// if any. const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { -if (auto *Info = ExplicitInfo.dyn

[clang] [cindex] Add API to query the class methods of a type (PR #123539)

2025-01-25 Thread Trevor Laughlin via cfe-commits
https://github.com/trelau updated https://github.com/llvm/llvm-project/pull/123539 >From bb0542e8f2ad50892ee9d2c1f76ec1def85c3e56 Mon Sep 17 00:00:00 2001 From: Trevor Laughlin Date: Sun, 19 Jan 2025 19:21:10 -0500 Subject: [PATCH 1/2] [cindex] Add API to query the class methods of a type ---

[clang] [clang-format] Treat uppercase identifiers after struct as macros (PR #124397)

2025-01-25 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes As we create defaul constructors lazily, we should not inherit from the parent evaluation context. However, we need to make an exception for lambdas (in particular their conversion operators, which are also imp

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast This p

[clang] [Clang] only inherit the parent eval context inside of lambdas (PR #124426)

2025-01-25 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/124426 As we create defaul constructors lazily, we should not inherit from the parent evaluation context. However, we need to make an exception for lambdas (in particular their conversion operators, which are also im

[clang] [clang] Migrate away from PointerUnion::dyn_cast (NFC) (PR #124425)

2025-01-25 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/124425 Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with //isa, cast and the llvm::dyn_cast This patch migrat

[clang] [clang][Modules] Raise empty.modulemap expected size to <70KB to fix RISC-V failure (PR #123959)

2025-01-25 Thread Alex Bradbury via cfe-commits
asb wrote: > It could be due to builtins, I believe we always serialize them, and that > would be different between targets. Does RISC-V have a lot of them compared > to other targets? That's almost certainly it then, thanks! We have a _lot_ of vector builtins in particular. https://github.c

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-01-25 Thread Aidan Goldfarb via cfe-commits
https://github.com/AidanGoldfarb ready_for_review https://github.com/llvm/llvm-project/pull/122754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-25 Thread Fangrui Song via cfe-commits
@@ -1,11 +1,20 @@ // RUN: %clang -### -S -fwrapv -fno-wrapv -fwrapv %s 2>&1 | FileCheck -check-prefix=CHECK1 %s // CHECK1: -fwrapv // +// RUN: %clang -### -S -fwrapv-pointer -fno-wrapv-pointer -fwrapv-pointer %s 2>&1 | FileCheck -check-prefix=CHECK1-POINTER %s +// CHECK1-POIN

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-25 Thread Fangrui Song via cfe-commits
@@ -1,11 +1,20 @@ // RUN: %clang -### -S -fwrapv -fno-wrapv -fwrapv %s 2>&1 | FileCheck -check-prefix=CHECK1 %s // CHECK1: -fwrapv // +// RUN: %clang -### -S -fwrapv-pointer -fno-wrapv-pointer -fwrapv-pointer %s 2>&1 | FileCheck -check-prefix=CHECK1-POINTER %s +// CHECK1-POIN

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/122486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Will be used by chromium and other users. There is some gap in sanitizer that is not so important. LGTM, but other reviewers need to stamp as well. https://github.com/llvm/llvm-project/pull/122486 __

[clang-tools-extra] [clang-tidy] Added support for 3-argument std::string ctor in bugprone-string-constructor check (PR #123413)

2025-01-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/123413 >From f5f0ba142a2eb71ce781faf4e15fcd225bec9ca8 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sat, 18 Jan 2025 00:49:29 +0300 Subject: [PATCH 1/3] [clang-tidy] Added support for 3-argument string ctor ---

[clang-tools-extra] [clang-tidy] add AllowedTypes option to misc-const-correctness (PR #122951)

2025-01-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/122951 >From 841cfec5a0ab4ce5ce64e71facfb7becaf4340e8 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 14 Jan 2025 22:05:43 +0300 Subject: [PATCH 1/5] [clang-tidy] add AllowedTypes to misc-const-correctness -

[clang] [clang] disallow narrowing when matching template template parameters (PR #124313)

2025-01-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124313 >From f2df46da93aeeaed9f774322231866a7509e3fa0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 12 Jan 2025 14:45:24 -0300 Subject: [PATCH] [clang] disallow narrowing when matching template template p

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-01-25 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,48 @@ +.. title:: clang-tidy - bugprone-smartptr-reset-ambiguous-call + +bugprone-smartptr-reset-ambiguous-call +== + +Finds potentially erroneous calls to ``reset`` method on vbvictor wrote: Done https://github.com

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-01-25 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/121291 >From 37dce6a7ed0cca2e9819c24f4d176c43e3c9f2ac Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 29 Dec 2024 15:32:22 +0300 Subject: [PATCH 1/8] [clang-tidy] Add bugprone-reset-call check --- .../bugpr

[clang] [clang] disallow narrowing when matching template template parameters (PR #124313)

2025-01-25 Thread Matheus Izvekov via cfe-commits
@@ -66,8 +66,9 @@ namespace DependentType { using ok = Pt, tT0>; using err1 = tT0; // expected-error {{too few template arguments for class template 'ii'}} // expected-note@-1 {{different template parameters}} - using err2 = tT0; // FIXME: sh

[clang] [Clang] call HandleImmediateInvocation before checking for immediate escacalating expressions (PR #124414)

2025-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes HandleImmediateInvocation can call MarkExpressionAsImmediateEscalating and should always be called before CheckImmediateEscalatingFunctionDefinition. However, we were not doing that in `ActFunctionBody`. We si

[clang] [Clang] call HandleImmediateInvocation before checking for immediate escacalating expressions (PR #124414)

2025-01-25 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/124414 HandleImmediateInvocation can call MarkExpressionAsImmediateEscalating and should always be called before CheckImmediateEscalatingFunctionDefinition. However, we were not doing that in `ActFunctionBody`. We s

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
thorsten-klein wrote: @EugeneZelenko What do you think about some additional option `EnforceNoNamespaceComments` in order to enforce that no namespace comment is present? If you like the idea, I could create some additional PR for introducing this option. https://github.com/llvm/llvm-project/

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
https://github.com/thorsten-klein edited https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
https://github.com/thorsten-klein edited https://github.com/llvm/llvm-project/pull/124265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -287,6 +287,11 @@ Changes in existing checks ` check to report a location even when the member location is not valid. +- Improved :doc:`google-readability-namespace-comments + ` check to + add an option ``AllowNoNamespaceComments``, that permits Eugen

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
https://github.com/thorsten-klein updated https://github.com/llvm/llvm-project/pull/124265 >From 9f3bc5021e6da87fa9a8db60b513acb87ed6b02f Mon Sep 17 00:00:00 2001 From: "Klein, Thorsten (GDE-EDSI1)" Date: Fri, 24 Jan 2025 13:46:24 +0100 Subject: [PATCH] added option AllowNoNamespaceComments for

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
@@ -287,6 +287,11 @@ Changes in existing checks ` check to report a location even when the member location is not valid. +- Improved :doc:`google-readability-namespace-comments + ` check to + add an option ``AllowNoNamespaceComments``, that permits thors

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -287,6 +287,11 @@ Changes in existing checks ` check to report a location even when the member location is not valid. +- Improved :doc:`google-readability-namespace-comments + ` check to + add an option ``AllowNoNamespaceComments``, that permits Eugen

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -184,6 +189,11 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { ND->isAnonymousNamespace() ? "anonymous namespace" : ("namespace '" + *NamespaceNameAsWritten + "'"); + // If no namespace comment is allo

[clang] Clang / SemaHLSL: Fix unused variable in release build (PR #124398)

2025-01-25 Thread Christoph Grüninger via cfe-commits
gruenich wrote: Already fixed by 7974f12b1e3682514bd58b35c5a784f35938fa04 https://github.com/llvm/llvm-project/pull/124398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang / SemaHLSL: Fix unused variable in release build (PR #124398)

2025-01-25 Thread Christoph Grüninger via cfe-commits
https://github.com/gruenich closed https://github.com/llvm/llvm-project/pull/124398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread Thorsten Klein via cfe-commits
https://github.com/thorsten-klein updated https://github.com/llvm/llvm-project/pull/124265 >From bade51bc7f0135e5c74cc64ee851a17813c6820f Mon Sep 17 00:00:00 2001 From: "Klein, Thorsten (GDE-EDSI1)" Date: Fri, 24 Jan 2025 13:46:24 +0100 Subject: [PATCH] added option AllowNoNamespaceComments for

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -39,3 +39,11 @@ Options An unsigned integer specifying the number of spaces before the comment closing a namespace definition. Default is `1U`. + + +.. option:: AllowNoNamespaceComments + + When true, the check will allow that namespace comments are ommitted + ent

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -402,6 +402,13 @@ Changes in existing checks ` check to use correct template type in ``std::min`` and ``std::max`` when operand is integer literal. +- Improved :doc:`google-readability-namespace-comments EugeneZelenko wrote: Please keep alphabetical o

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -402,6 +402,13 @@ Changes in existing checks ` check to use correct template type in ``std::min`` and ``std::max`` when operand is integer literal. +- Improved :doc:`google-readability-namespace-comments + ` that permits + omitting namespace comments entirely. With

[clang-tools-extra] added option `google-readability-namespace-comments.AllowNoNamespaceComments` (PR #124265)

2025-01-25 Thread via cfe-commits
@@ -39,3 +39,11 @@ Options An unsigned integer specifying the number of spaces before the comment closing a namespace definition. Default is `1U`. + + +.. option:: AllowNoNamespaceComments + + When true, the check will allow that namespace comments are ommitted ---

[clang-tools-extra] [clang-tidy] Replace /* ... */ single-line comments with // ... comments (PR #124319)

2025-01-25 Thread via cfe-commits
@@ -0,0 +1,40 @@ +.. title:: clang-tidy - use-cpp-style-comments + +modernize-use-cpp-style-comments + + +Replace C-style comments with C++-style comments. +C-style comments (``/* ... */``) are inherited from C, while C++ introduces +``//`` as a mo

[clang-tools-extra] [clang-tidy] Replace /* ... */ single-line comments with // ... comments (PR #124319)

2025-01-25 Thread via cfe-commits
@@ -0,0 +1,127 @@ +//===--- UseCppStyleCommentsCheck.cpp - clang-tidy-===// + +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang-tidy] Replace /* ... */ single-line comments with // ... comments (PR #124319)

2025-01-25 Thread via cfe-commits
@@ -173,6 +173,11 @@ New checks Replace comparisons between signed and unsigned integers with their safe C++20 ``std::cmp_*`` alternative, if available. + +- New :doc:`modernize-use-cpp-style-comments EugeneZelenko wrote: Should be before `modernize-use

[clang-tools-extra] [clang-tidy] Replace /* ... */ single-line comments with // ... comments (PR #124319)

2025-01-25 Thread via cfe-commits
@@ -0,0 +1,40 @@ +//===--- UseCppStyleCommentsCheck.h - clang-tidy---===// EugeneZelenko wrote: ```suggestion //===--- UseCppStyleCommentsCheck.h - clang-tidy-*- C++ -*-===// ``` https://github.com/llvm/llvm-project/pull/

[clang-tools-extra] [clang-tidy] Replace /* ... */ single-line comments with // ... comments (PR #124319)

2025-01-25 Thread via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %check_clang_tidy -std=c++11 %s modernize-use-cpp-style-comments %t -- -- + +// Single-line full C-style comment +static const int CONSTANT = 42; /* Important constant value */ +// CHECK-MESSAGES: :[[@LINE-1]]:33: warning: use C++ style comments '//' in

  1   2   >