Commit Graph

31 Commits

Author SHA1 Message Date
Petr Hosek 7003f64c1e [clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

Differential Revision: https://reviews.llvm.org/D72954
2020-03-06 17:37:08 -08:00
Petr Hosek ea086d10ce Revert "[clang-doc] Improving Markdown Output"
This reverts commit 45499f3801, it's
still failing on Windows bots.
2020-03-04 16:00:22 -08:00
Petr Hosek 45499f3801 [clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

Differential Revision: https://reviews.llvm.org/D72954
2020-03-04 14:42:07 -08:00
Petr Hosek 7b627bb6e0 Revert "[clang-doc] Improving Markdown Output"
This reverts commit dac21fdd59 as this
is failing on Windows.
2020-02-07 19:43:47 -08:00
Petr Hosek dac21fdd59 [clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

Differential Revision: https://reviews.llvm.org/D72954
2020-02-07 19:17:03 -08:00
Diego Astiazaran b46131e5c3 [clang-doc] Fix records in global namespace
When a Record is declared in the global namespace, clang-doc serializes
it as a child of the global namespace, so the global namespace is now
one if its parent namespaces. This namespace was not being included in
the list of namespaces of the Info causing paths to be incorrect and the
index rendered incorrectly.
Affected tests have been fixed.

Differential revision: https://reviews.llvm.org/D66298

llvm-svn: 369123
2019-08-16 16:10:32 +00:00
Diego Astiazaran 6a29ae4bde [clang-doc] Fix bitcode writer for access specifiers
Bitcode writer was not emitting the corresponding record for the Access attribute of a FunctionInfo. This has been added.
AS_none was being used as the default value for any AcesssSpecifier attribute
(in FunctionInfo and MemberTypeInfo), this has been changed to AS_public
because this is the enum value that evaluates to 0.
The bitcode writer doesn't write values that are 0 so if an attribute
was set to AS_public, this value is not written and after reading the
bitcode it would have the default value which is AS_none. This is why
the default value is now AS_public.

Differential Revision: https://reviews.llvm.org/D66151

llvm-svn: 369063
2019-08-15 23:04:27 +00:00
Julie Hockett 9e22b4c76d [clang-doc] Switch to default to all-TUs executor
Since we generally want to document a whole project, not just one file.

Differential Revision: https://reviews.llvm.org/D53170

llvm-svn: 345418
2018-10-26 19:11:34 +00:00
Julie Hockett 229c63b021 [clang-doc] Limit integration tests
Now that the clang-doc libraries are covered by unit tests, we don't
need to have extensive (and unmaintainable) integration tests. This
replaces the integration test suite with a smaller one that just tests
the tool itself and removes extraneous dumping logic from the tool
itself.

Includes tests that cover the parse->serialize->merge->generate
pipeline, as well as tests for the --public, --format, --doxygen, and
--output flags.

Differential Revision: https://reviews.llvm.org/D53150

llvm-svn: 344655
2018-10-16 23:07:37 +00:00
Julie Hockett f276624e87 [clang-doc] Add unit tests for bitcode
Adds unit tests for the BitcodeWriter and BitcodeReader libraries.

This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.

Differential Revision: https://reviews.llvm.org/D53082

llvm-svn: 344651
2018-10-16 23:06:53 +00:00
Julie Hockett e122f94fa0 [clang-doc] Clean up Markdown output
Make the output for the MDGenerator cleaner and more readable.

Differential Revision: https://reviews.llvm.org/D52754

llvm-svn: 343818
2018-10-04 21:34:13 +00:00
Julie Hockett 73a4d54f81 [clang-doc] Avoid parsing undefined base classes
Don't try to parse base classes for declarations that are not
definitions (segfaults, as there is no DefinitionData to access).

Differential Revision: https://reviews.llvm.org/D52313

llvm-svn: 343703
2018-10-03 18:25:27 +00:00
Julie Hockett ac68cab9e1 Reland "Implement a (simple) Markdown generator"
Relanding with fixes to tests for the failing bots.

Differential Revision: https://reviews.llvm.org/D43424

llvm-svn: 341955
2018-09-11 15:56:55 +00:00
Julie Hockett 921e195633 Revert "Implement a (simple) Markdown generator"
This reverts commit r339948, as it's breaking a few bots in ways that I
can't reproduce right now.

llvm-svn: 339966
2018-08-16 23:50:51 +00:00
Julie Hockett 1bcd1b0324 Implement a (simple) Markdown generator
Implementing a simple Markdown generator from the emitted bitcode
summary of declarations. Very primitive at this point, but will be
expanded. Currently emits an .md file for each class and namespace,
listing its contents.

For a more detailed overview of the tool, see the design document
on the mailing list:
http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html

Differential Revision: https://reviews.llvm.org/D43424

llvm-svn: 339948
2018-08-16 21:54:34 +00:00
Julie Hockett 4955422f9e [clang-doc] Pass over function-internal declarations
llvm-svn: 339592
2018-08-13 18:05:50 +00:00
Julie Hockett 8899c29b1e Reland "[clang-doc] Refactoring mapper to map by scope"
Relanding with a minor change to prevent an assertion on release bots.

The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the class
or namespace in which they are defined). Namespace and Record infos are
passed along to the final output, but the second pass creates a reference
to each in its parent scope. As a result, the top-level final outputs are
Namespaces and Records.

Differential Revision: https://reviews.llvm.org/D48341

llvm-svn: 338763
2018-08-02 20:10:17 +00:00
Julie Hockett a9cb2dd8b0 Revert "[clang-doc] Refactoring mapper to map by scope"
This reverts commit r338738 as it's breaking the bots.

llvm-svn: 338748
2018-08-02 18:01:37 +00:00
Julie Hockett 1f430693b1 [clang-doc] Refactoring mapper to map by scope
The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the
class or namespace in which they are defined). Namespace and Record
infos are passed along to the final output, but the second pass creates
a reference to each in its parent scope. As a result, the top-level final
outputs are Namespaces and Records.

llvm-svn: 338738
2018-08-02 17:17:19 +00:00
Julie Hockett b218069826 [clang-doc] Create a script to generate tests
Upstreaming the script I use to generate clang-doc tests (and updating
the existing tests to use it)

Differential Revision: https://reviews.llvm.org/D49268

llvm-svn: 337632
2018-07-20 23:00:34 +00:00
Julie Hockett eb50a2e8d4 [clang-doc] Adding PublicOnly flag
Submitted on behalf of Annie Cherkaev (@anniecherk)

Added a flag which, when enabled, documents only those methods and
fields which have a Public attribute.

Differential Revision: https://reviews.llvm.org/D48395

llvm-svn: 337602
2018-07-20 18:49:55 +00:00
Julie Hockett e78f30183e [clang-doc] Implement a YAML generator
Implmenting a YAML generator from the emitted bitcode summary of
declarations. Emits one YAML file for each declaration information.

For a more detailed overview of the tool, see the design document on the mailing list: http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html

llvm-svn: 334103
2018-06-06 16:13:17 +00:00
Julie Hockett d0f9a87215 [clang-doc] Implement reducer portion of the frontend framework
Implements a simple, in-memory reducer for the mapped output of the
initial tool. This creates a collection object for storing the
deduplicated infos on each declaration, and populates that from the
mapper output. The collection object is serialized to LLVM
bitstream. On reading each serialized output, it checks to see if a
merge is necessary and if so, merges the new info with the existing
info (prefering the existing one if conflicts exist).

For a more detailed overview of the tool, see the design document
on the mailing list:
http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html

Differential Revision: https://reviews.llvm.org/D43341

llvm-svn: 333932
2018-06-04 17:22:20 +00:00
Julie Hockett b59cd77c87 [clang-doc] Attaching a name to reference data
This adds the name of the referenced decl, in addition to its USR, to
the saved data, so that the backend can look at an info in isolation and
still be able to construct a human-readable name for it.

Differential Revision: https://reviews.llvm.org/D46281

llvm-svn: 331539
2018-05-04 17:02:13 +00:00
Julie Hockett e975a473b7 [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"
Fixed windows release build tests.

llvm-svn: 328270
2018-03-22 23:34:46 +00:00
Julie Hockett 2a0373a2db Revert "[clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework""
This reverts commit r328150 until we can fix the test that are failing
on the Windows release build.

llvm-svn: 328172
2018-03-22 02:05:51 +00:00
Julie Hockett 1442a5dd3a [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"
Fixing the the failing Windows tests.

llvm-svn: 328150
2018-03-21 21:21:45 +00:00
Julie Hockett 729d9f868b Revert "Reland "[clang-doc] Setup clang-doc frontend framework""
This reverts commit r327295 since it was causing the Windows bots to
fail.

llvm-svn: 327346
2018-03-12 23:23:24 +00:00
Julie Hockett 93be22f418 Reland "[clang-doc] Setup clang-doc frontend framework"
There was a missing newline in the docs, and a static_assert that needed
to be a normal assert.

llvm-svn: 327295
2018-03-12 17:05:14 +00:00
Julie Hockett c8922c16fb Revert "[clang-doc] Setup clang-doc frontend framework"
This reverts commit r327102, since it was breaking the linux-abi-test on
x86.

llvm-svn: 327103
2018-03-09 03:47:18 +00:00
Julie Hockett 671812462a [clang-doc] Setup clang-doc frontend framework
Setting up the mapper part of the frontend framework for a clang-doc
tool. It creates a series of relevant matchers for declarations, and
uses the ToolExecutor to traverse the AST and extract the matching
declarations and comments. The mapper serializes the extracted
information to individual records for reducing and eventually doc
generation.

For a more detailed overview of the tool, see the design document on the
mailing list: http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html

Differential Revision: https://reviews.llvm.org/D41102

llvm-svn: 327102
2018-03-09 03:16:39 +00:00