[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,99 @@ +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/StringSaver.h" +#include + +using namespace llvm; + +namesp

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,99 @@ +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/StringSaver.h" +#include + +using namespace llvm; + +namesp

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,99 @@ +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_MD_PARSER_H +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/StringSaver.h" +#include + +using namespace llvm; + +namesp

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang-tools-extra] [clang-doc] add Markdown parser (PR #155887)

2025-08-29 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,229 @@ +#include "MDParser.h" +#include "clang/Basic/CharInfo.h" +#include "llvm/ADT/AllocatorList.h" + +namespace clang { +namespace doc { +namespace { +bool isEmphasisDelimiter(char &Token) { + // TODO: support '_' + if (Token == '*') +return true; + return fal

[clang] [Fuchsia] Use IR PGO in the Fuchsia toolchain build (PR #156060)

2025-08-29 Thread Paul Kirth via cfe-commits
ilovepi wrote: * **#156060** https://app.graphite.dev/github/pr/llvm/llvm-project/156060?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> šŸ‘ˆ https://app.graphite.dev/github/pr/llvm/llvm-project/1560

[clang-tools-extra] [clang-doc][NFC] Fix missing documentation for EndLineNumber (PR #138051)

2025-08-29 Thread Paul Kirth via cfe-commits
ilovepi wrote: Eh, this isn't really needed. https://github.com/llvm/llvm-project/pull/138051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc][NFC] Fix missing documentation for EndLineNumber (PR #138051)

2025-08-29 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/138051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Use IR PGO in the Fuchsia toolchain build (PR #156060)

2025-08-29 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/156060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Use IR PGO in the Fuchsia toolchain build (PR #156060)

2025-08-29 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi auto_merge_enabled https://github.com/llvm/llvm-project/pull/156060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Use IR PGO in the Fuchsia toolchain build (PR #156060)

2025-08-29 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/156060 After #155957 pointed it out, we're actually using the frontend PGO in the Fuchsia cmake cache files. >From 42d2e68d4d3e0f16ffe49f1512075bb57237b74c Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Fri, 29 Aug 2

[clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

2025-08-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/154618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] lower filename length limit by 5 (PR #155511)

2025-08-26 Thread Paul Kirth via cfe-commits
ilovepi wrote: > LGTM, but I thought we had a unit test for this? Am I misremembering? Looking at the source: I am wrong and we never had one. https://github.com/llvm/llvm-project/pull/155511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang-tools-extra] [clang-doc] lower filename length limit by 5 (PR #155511)

2025-08-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM, but I thought we had a unit test for this? Am I misremembering? https://github.com/llvm/llvm-project/pull/155511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

2025-08-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi commented: LGTM from my perspective. Its worth noting that I'm not one of the normal maintainers of UBSan though. My team is just eager for this feature for our embedded/kernel users. I'll defer to @vitalybuka and @thurstond since they deal with this part of the code

[clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

2025-08-26 Thread Paul Kirth via cfe-commits
@@ -1,9 +1,32 @@ // RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \ -// RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow -emit-llvm %s -o - | FileCheck %s +// RUN: -fsanitize=signed-integer-overf

[clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

2025-08-25 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,21 @@ +//===--===// +// +// 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: Apac

[clang] [Clang] improve -Wstring-concatenation to warn on every missing comma in initializer lists (PR #154018)

2025-08-19 Thread Paul Kirth via cfe-commits
ilovepi wrote: FWIW, we're seeing this in Fuchsia too. Bot: https://ci.chromium.org/ui/p/fuchsia/builders/global.ci/clang_toolchain.ci.core.x64-debug-tot-build_only/b8706156533673690033/overview Logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8706156533673690033/+/u/bu

[clang] [llvm] [llvm][AsmPrinter] Emit call graph section (PR #87576)

2025-07-31 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,58 @@ +/// Test the callgraph section to make sure the indirect callsites +/// (annotated by generated temporary labels .Ltmp*) are associated +/// with the corresponding callee type identifiers. + +// RUN: llvm-mc -triple=x86_64 -filetype=obj -o - < %s | llvm-readelf -

[clang-tools-extra] [clang-doc] add return comments to comment template (PR #150647)

2025-07-25 Thread Paul Kirth via cfe-commits
ilovepi wrote: I ran into a similar problem, and Nikita had to cancel the whole thing (IIRC by closing the PR and then reopening). It was not great, so I normally just merge them one at a time now. https://github.com/llvm/llvm-project/pull/150647 ___

[clang-tools-extra] [clang-doc] place HTML/JSON output inside their own directories (PR #150655)

2025-07-25 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. Is the plan just to handle this for JSON and Mustache for now, and when we have templates for Markdown (and whatever else) they'll just use this pattern? And I guess migrate any tests we want to keep for HTML once we switch to the mustache

[clang-tools-extra] [clang-doc] generate comments for functions (PR #150570)

2025-07-25 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/150570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Add BOOTSTRAP_BOOTSTRAP flags for PGO (PR #150448)

2025-07-24 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/150448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia] Add STAGE2 flags for PGO (PR #150414)

2025-07-24 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/150414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Emit ā€œtrap reasonsā€ on UBSan traps (PR #145967)

2025-07-23 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/145967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Add CalleeTypeIds field to CallSiteInfo (PR #87574)

2025-07-23 Thread Paul Kirth via cfe-commits
ilovepi wrote: LGTM w/ the improved/reduced tests. https://github.com/llvm/llvm-project/pull/87574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] refactor JSON for better Mustache compatibility (PR #149588)

2025-07-21 Thread Paul Kirth via cfe-commits
@@ -777,7 +778,10 @@ static void populateSymbolInfo(SymbolInfo &I, const T *D, const FullComment *C, Mangler->mangleCXXVTable(CXXD, MangledStream); else MangledStream << D->getNameAsString(); - I.MangledName = MangledName; + if (MangledName.size() > 255) +I.Man

[clang-tools-extra] [clang-doc] refactor JSON for better Mustache compatibility (PR #149588)

2025-07-21 Thread Paul Kirth via cfe-commits
@@ -234,10 +267,12 @@ static void serializeArray(const Container &Records, Object &Obj, json::Value RecordsArray = Array(); auto &RecordsArrayRef = *RecordsArray.getAsArray(); RecordsArrayRef.reserve(Records.size()); - for (const auto &Item : Records) { + for (size_t I

[clang] [Fuchsia] Support PGO (PR #128680)

2025-07-18 Thread Paul Kirth via cfe-commits
ilovepi wrote: We haven't enabled it yet. Other priorities have taken precedence, but we're in the middle of enabling it now. https://github.com/llvm/llvm-project/pull/128680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang-tools-extra] [clang-doc] integrate JSON generator with Mustache templates (PR #149006)

2025-07-18 Thread Paul Kirth via cfe-commits
ilovepi wrote: Is it possible to do all the JSON refactoring as the first PR, and then do the mustache integration after? I believe those can be split w/o too much trouble. https://github.com/llvm/llvm-project/pull/149006 ___ cfe-commits mailing list

[clang-tools-extra] [clang-doc] integrate JSON generator with Mustache templates (PR #149006)

2025-07-18 Thread Paul Kirth via cfe-commits
@@ -34,7 +34,7 @@ class Foo; // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: -// CHECK-NEXT: enum Color ilovepi wrote: Is there a reason we'd want to drop this? Writing out that its an

[clang-tools-extra] [clang-doc] integrate JSON generator with Mustache templates (PR #149006)

2025-07-18 Thread Paul Kirth via cfe-commits
@@ -59,7 +59,7 @@ class Foo; // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: -// CHECK-NEXT: Defined at line 5 of file {{.*}}mustache-index.cpp +// CHECK: Defined at line 5 of file {{.*}}mustache-inde

[clang-tools-extra] [clang-doc] integrate JSON generator with Mustache templates (PR #149006)

2025-07-17 Thread Paul Kirth via cfe-commits
ilovepi wrote: Looking at the patch, I'm wondering if we can decouple the changes to output and add things like missing features in separate patches? There seems to be more changing than I expected in the template and tests. So if we can have a transition thats basically a NOP (or as close as

[clang-tools-extra] [clang-doc] fix ASan complaints from passing RepositoryURL as reference (PR #148923)

2025-07-15 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM, assuming the complaint is from the optional and not the StringRef. https://github.com/llvm/llvm-project/pull/148923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [llvm] [DTLTO][Clang] Add support for Integrated Distributed ThinLTO (PR #147265)

2025-07-15 Thread Paul Kirth via cfe-commits
ilovepi wrote: > @Prabhuk I might need some help here. Looking at the output for the `Clang :: > Driver/DTLTO/dtlto.c test` on your buildbot LLD is being invoked with the > argument `"--thinlto-remote-compiler=/b/s/w/ir/x/w/llvm_build/bin/llvm"`. > That is clearly not the location of a Clang c

[clang] [llvm] [DTLTO][Clang] Add support for Integrated Distributed ThinLTO (PR #147265)

2025-07-15 Thread Paul Kirth via cfe-commits
ilovepi wrote: I see this patch also failing its own tests in our ci ``` TEST 'Clang :: Driver/DTLTO/dtlto.c' FAILED Exit Code: 1 Command Output (stderr): -- /b/s/w/ir/x/w/llvm_build/bin/clang -flto=thin /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Drive

[clang] [Clang][CodeGen] Emit ā€œtrap reasonsā€ on UBSan traps (PR #145967)

2025-07-11 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \ +// RUN: -fsanitize=float-cast-overflow -fsanitize-trap=float-cast-overflow -emit-llvm %s -o - | FileCheck %s + +int f(float x) { + return (int)x; +} + +//

[clang] [llvm] [DTLTO][Clang] Add support for Integrated Distributed ThinLTO (PR #147265)

2025-07-11 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,43 @@ +// REQUIRES: lld + +/// Check DTLTO options are forwarded to the linker. + +// RUN: echo "--target=x86_64-linux-gnu \ +// RUN: -Xthinlto-distributor=distarg1 \ +// RUN: -Xthinlto-distributor=distarg2,distarg3 \ +// RUN: -fuse-ld=lld" > %t.rsp --

[clang-tools-extra] [clang-doc] Serialize record files with mangled name (PR #148021)

2025-07-10 Thread Paul Kirth via cfe-commits
@@ -378,6 +378,7 @@ struct SymbolInfo : public Info { std::optional DefLoc; // Location where this decl is defined. llvm::SmallVector Loc; // Locations where this decl is declared. bool IsStatic = false; + SmallString<16> MangledName; ilovepi wrote:

[clang-tools-extra] [clang-doc] Serialize record files with mangled name (PR #148021)

2025-07-10 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM, with some minor comments. https://github.com/llvm/llvm-project/pull/148021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Serialize record files with mangled name (PR #148021)

2025-07-10 Thread Paul Kirth via cfe-commits
@@ -501,15 +502,26 @@ Error JSONGenerator::generateDocs( SmallString<128> Path; sys::path::native(RootDir, Path); -sys::path::append(Path, Info->getRelativeFilePath("")); if (!CreatedDirs.contains(Path)) { if (std::error_code Err = sys::fs::create_direc

[clang-tools-extra] [clang-doc] Serialize record files with mangled name (PR #148021)

2025-07-10 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/148021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Emit ā€œtrap reasonsā€ on UBSan traps (PR #145967)

2025-07-10 Thread Paul Kirth via cfe-commits
ilovepi wrote: > I wouldn't say it's orthogonal. It's a very interesting implementation idea > but there are several reasons why we don't want to pursue it right now. > > 1. What you are proposing is significantly more complicated than what is > implemented in this PR. This work being part of

[clang] [Clang][CodeGen] Emit ā€œtrap reasonsā€ on UBSan traps (PR #145967)

2025-07-10 Thread Paul Kirth via cfe-commits
ilovepi wrote: > @ilovepi > > > There's a large number of tests. Many of these look like they're close to > > an existing test ... in these cases is it possible to just use the existing > > test file and add checks under a prefix? > > I originally recommended that @anthonyhatran write new tes

[clang-tools-extra] [clang-doc] emit IsBuiltIn and IsTemplate for types (PR #146149)

2025-06-27 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM. Maybe use `[clang-doc] Serialize IsBuiltIn and IsTemplate for types` as the title? https://github.com/llvm/llvm-project/pull/146149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang-tools-extra] [clang-doc] refactor BitcodeReader::readSubBlock (PR #145835)

2025-06-26 Thread Paul Kirth via cfe-commits
@@ -800,11 +800,37 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) { } } -// TODO: Create a helper that can receive a function to reduce repetition for -// most blocks. +template +llvm::Error ClangDocBitcodeReader::handleSubBlock(unsigned ID, T Parent, +

[clang-tools-extra] [clang-doc] refactor BitcodeReader::readSubBlock (PR #145835)

2025-06-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/145835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] refactor BitcodeReader::readSubBlock (PR #145835)

2025-06-26 Thread Paul Kirth via cfe-commits
@@ -800,11 +800,37 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) { } } -// TODO: Create a helper that can receive a function to reduce repetition for -// most blocks. +template +llvm::Error ClangDocBitcodeReader::handleSubBlock(unsigned ID, T Parent, +

[clang-tools-extra] [clang-doc] refactor BitcodeReader::readSubBlock (PR #145835)

2025-06-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM, modulo the one Q. https://github.com/llvm/llvm-project/pull/145835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] refactor JSONGenerator array usage (PR #145595)

2025-06-25 Thread Paul Kirth via cfe-commits
@@ -454,27 +417,19 @@ static void serializeInfo(const RecordInfo &I, json::Object &Obj, Obj["ProtectedMembers"] = ProtectedMembersArray; } - if (!I.Bases.empty()) { -json::Value BasesArray = Array(); -json::Array &BasesArrayRef = *BasesArray.getAsArray(); -

[clang-tools-extra] [clang-doc] refactor JSONGenerator array usage (PR #145595)

2025-06-25 Thread Paul Kirth via cfe-commits
@@ -278,6 +247,16 @@ static void serializeInfo(const ConstraintInfo &I, Object &Obj) { Obj["Expression"] = I.ConstraintExpr; } +static void serializeInfo(const std::vector &Params, ilovepi wrote: ```suggestion static void serializeInfo(ArrayRef Params, ```

[clang-tools-extra] [clang-doc] refactor JSONGenerator array usage (PR #145595)

2025-06-25 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/145595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] refactor JSONGenerator array usage (PR #145595)

2025-06-25 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM. Glad to see so much code getting deleted! Overall great cleanups. Left a couple small comments inline. https://github.com/llvm/llvm-project/pull/145595 ___ cfe-commits mailing list cfe-commi

[clang-tools-extra] [clang-doc] mangle template specialization file names (PR #144617)

2025-06-20 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/144617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] mangle template specialization file names (PR #144617)

2025-06-20 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,15 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/_ZTT7MyClassIiE.json ilovepi wrote: I guess this serves the same purpose, but it'd be nice to have

[clang-tools-extra] [clang-doc] mangle template specialization file names (PR #144617)

2025-06-20 Thread Paul Kirth via cfe-commits
@@ -909,6 +910,13 @@ emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc, RI->Template.emplace(); RI->Template->Specialization.emplace(); auto &Specialization = *RI->Template->Specialization; +auto *Mangler = ItaniumMangleContext::create( +

[clang-tools-extra] [clang-doc] mangle template specialization file names (PR #144617)

2025-06-20 Thread Paul Kirth via cfe-commits
@@ -209,6 +209,9 @@ struct TemplateSpecializationInfo { // Template parameters applying to the specialized record/function. std::vector Params; + + // Used to distinguish class specialization file names. + std::optional> MangledName; ilovepi wrote: can

[clang-tools-extra] [clang-doc] mangle template specialization file names (PR #144617)

2025-06-20 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM. I left a couple of comments, but overall this looks like its in a good state. https://github.com/llvm/llvm-project/pull/144617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)

2025-06-13 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/144160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)

2025-06-13 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +template +concept Addable = requires(T a, T b) { + { a + b }; +}; + +templat

[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)

2025-06-13 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %s ilovepi wrote: Let’s try to mark it fail with filecheck. If that’s doesn’t work, I’m ok with this. https://github.c

[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)

2025-06-13 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. Let, module some minor comments. https://github.com/llvm/llvm-project/pull/144160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)

2025-06-13 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/144160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] remove default label on some switches (PR #143919)

2025-06-13 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/143919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] remove default label on some switches (PR #143919)

2025-06-13 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/143919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [llvm] add tool to verify mustache library (PR #111487)

2025-06-11 Thread Paul Kirth via cfe-commits
ilovepi wrote: This was completed in https://github.com/llvm/llvm-project/pull/142813 https://github.com/llvm/llvm-project/pull/111487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [llvm] add tool to verify mustache library (PR #111487)

2025-06-11 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/111487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-09 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,193 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +struct Foo; + +// This is a nice class. +// It has some nice methods and fields. +// @brief This is

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-09 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi deleted https://github.com/llvm/llvm-project/pull/142483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-09 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,193 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +struct Foo; + +// This is a nice class. +// It has some nice methods and fields. +// @brief This is

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-09 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,175 @@ +#include "ClangDocTest.h" +#include "Generators.h" +#include "Representation.h" +#include "gtest/gtest.h" + +namespace clang { +namespace doc { + +static std::unique_ptr getJSONGenerator() { + auto G = doc::findGeneratorByName("json"); + if (!G) +return nu

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-08 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +struct Foo; + +// This is a nice class. +// It has some nice methods and fields. +// @brief This is

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-08 Thread Paul Kirth via cfe-commits
ilovepi wrote: @snarang181 I cannot see how this patch would affect a test in the JIT. Sometimes main is not clean, and sometime there is flake in some tests or under a sanitizer. We should be good IMO. https://github.com/llvm/llvm-project/pull/142273

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-07 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM. Thanks for the patch https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/142483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +struct Foo; + +// This is a nice class. +// It has some nice methods and fields. +// @brief This is

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,40 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: clang-doc --output=%t --format=json --executor=standalone %s +// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json + +struct MyClass { + template T methodTemplate(T param) { + } +}; + +// CHECK: "PublicFunct

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -670,12 +671,17 @@ static std::unique_ptr genHTML(const CommentInfo &I) { return nullptr; return std::move(BlockComment); } - if (I.Kind == "TextComment") { -if (I.Text == "") + + case CommentKind::CK_TextComment: { +if (I.Text.empty()) return n

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -316,8 +316,13 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, static llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, CommentInfo *I) { switch (ID) { - case COMMENT_KIND: -return decodeRecord(

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. LGTM once the last few nits are addressed. https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,430 @@ +#include "Generators.h" +#include "clang/Basic/Specifiers.h" +#include "llvm/Support/JSON.h" + +using namespace llvm; +using namespace llvm::json; + +namespace clang { +namespace doc { + +class JSONGenerator : public Generator { +public: + static const char *Fo

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. I think this is a good start, modulo a couple fixes on reserving space in json::Arrays. I'm fine if we keep incrementally adding testing rather than doing it all up front. When we're done I imagine most of the YAML tests can be converted,

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-06 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,430 @@ +#include "Generators.h" +#include "clang/Basic/Specifiers.h" +#include "llvm/Support/JSON.h" + +using namespace llvm; +using namespace llvm::json; + +namespace clang { +namespace doc { + +class JSONGenerator : public Generator { +public: + static const char *Fo

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
ilovepi wrote: Oh, lets updated the PR description with a more complete description of the change. It can also be marked as `Fixes #NNN` since this basically implements everything outlined in the issues, unless I'm forgetting something. https://github.com/llvm/llvm-project/pull/142273

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
@@ -208,37 +208,107 @@ static json::Value extractValue(const TypedefInfo &I) { } static json::Value extractValue(const CommentInfo &I) { - assert((I.Kind == "BlockCommandComment" || I.Kind == "FullComment" || - I.Kind == "ParagraphComment" || I.Kind == "TextComment")

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi commented: Getting pretty close. I think once the remaining comments are addressed it will probably be ready to land. https://github.com/llvm/llvm-project/pull/142273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-05 Thread Paul Kirth via cfe-commits
ilovepi wrote: > > This sounds promising. I'm fine w/ adding a field to track this. BTW, what > > does clang do? I'm wondering if we should track more than 1-bit of info > > here. > > As far as I can tell, inside the AST Clang makes use of the `isa<>` > mechanisms (which we could also leverag

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
@@ -316,8 +316,13 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, static llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, CommentInfo *I) { switch (ID) { - case COMMENT_KIND: -return decodeRecord(

[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

2025-06-05 Thread Paul Kirth via cfe-commits
@@ -208,37 +208,105 @@ static json::Value extractValue(const TypedefInfo &I) { } static json::Value extractValue(const CommentInfo &I) { - assert((I.Kind == "BlockCommandComment" || I.Kind == "FullComment" || - I.Kind == "ParagraphComment" || I.Kind == "TextComment")

[clang-tools-extra] [clang-doc] add a JSON generator (PR #142483)

2025-06-04 Thread Paul Kirth via cfe-commits
ilovepi wrote: > If we're open to adding a flag in the base `Info` like > `IsClassSpecialization`, then we can probably easily deal with these by > trying to reconstruct the specialization's arguments (will be something like > "Foo.json"). Functions don't produce their own files so function >

  1   2   3   4   5   6   7   8   9   10   >