summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/Representation.h
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-041-1/+1
|
* Retire llvm::less/equal in favor of C++14 std::less<>/equal_to<>.Benjamin Kramer2019-08-221-2/+2
| | | | llvm-svn: 369674
* [clang-doc] Redesign of generated HTML filesDiego Astiazaran2019-08-161-2/+3
| | | | | | | | | | | | | The new design includes a header (contains the project name), a main section, and a footer. The main section is divided into three subsections. Left, middle, right. The left section contains the general index, the middle contains the info's data, and the right contains the index for the info's content. The CSS has been updated. A flag --project-name is added. The Attributes attribute of the TagNode struct is now a vector of pairs because these attributes should be rendered in the insertion order. The functions (cpp and js) that converts an Index tree structure into HTML were slightly modified; the first ul tag created is now a ol tag. The inner lists are still ul. Differential Revision: https://reviews.llvm.org/D66353 llvm-svn: 369139
* [clang-doc] Serialize inherited attributes and methodsDiego Astiazaran2019-08-161-4/+23
| | | | | | | | | | | clang-doc now serializes the inherited attributes and methods, not only the name of the base class. All inherited are tracked, if B:A and C:B, info of A is included in C. This data is stored in attribute Bases in a RecordInfo. Previously tracked inheritance data, stored in Parents and VParents, hasn't been removed to reduce review load. Differential revision: https://reviews.llvm.org/D66238 llvm-svn: 369075
* [clang-doc] Sort index elements case insensitiveDiego Astiazaran2019-08-151-2/+4
| | | | | | | | Implement logic to compare the references of the index case insensitive. Differential revision: https://reviews.llvm.org/D66299 llvm-svn: 369068
* [clang-doc] Fix bitcode writer for access specifiersDiego Astiazaran2019-08-151-5/+9
| | | | | | | | | | | | | | | 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
* [clang-doc] Add missing check in testsDiego Astiazaran2019-08-141-0/+7
| | | | | | | | Path is now checked when comparing two Infos in the unit tests. Differential Revision: https://reviews.llvm.org/D66124 llvm-svn: 368912
* [clang-doc] Generate HTML links for children namespaces/recordsDiego Astiazaran2019-08-121-0/+3
| | | | | | | | | | | | | | | | Path is now stored in the references to the child while serializing, then this path is used to generate the relative path in the HTML generator. Now some references have paths and some don't so in the reducing phase, references are now properly merged checking for empty attributes. Tests added for HTML and YAML generators, merging and serializing. computeRelativePath function had a bug when the filepath is part of the given directory; it returned a path that starts with a separator. This has been fixed. Differential Revision: https://reviews.llvm.org/D65987 llvm-svn: 368602
* [clang-format] Add link to source code in file definitionsDiego Astiazaran2019-08-091-8/+16
| | | | | | | | | | | | | Two command line options have been added to clang-doc. --repository=<string> - URL of repository that hosts code; used for links to definition locations. --source-root=<string> - Directory where processed files are stored. Links to definition locations will only be generated if the file is in this dir. If the file is in the source-root and a repository options is passed; a link to the source code will be rendered by the HTML generator. Differential Revision: https://reviews.llvm.org/D65483 llvm-svn: 368460
* [clang-doc] Add second index for sections within info's contentDiego Astiazaran2019-08-071-0/+3
| | | | | | | | | | | | This new index contains links to the main section of infos: Namespaces, Records, Functions, Enums, Members. Also to each child function or enum. Index is currently rendered on top of the info content, this will be fixed later with CSS. Depends on D65690. Differential Revision: https://reviews.llvm.org/D65030 llvm-svn: 368209
* [clang-doc] Add index in each info html fileDiego Astiazaran2019-08-061-1/+28
| | | | | | | | | | | | An index structure is created while generating the output file for each info. This structure is parsed to JSON and written to a file in the output directory. The html for the index is not rendered by clang-doc. A Javascript file is included in the output directory, this will the JSON file and insert HTML elements into the file. Differential Revision: https://reviews.llvm.org/D65690 llvm-svn: 368070
* [clang-doc] Fix link generationDiego Astiazaran2019-08-061-4/+14
| | | | | | | | | | | | | | | | | | | Before making a link to a reference it is required to check that the reference has a path (eg. primitives won't have paths). This was done by checking if the path was empty; that worked because when generating paths the outdirectory was included, so if the path was assigned it had that outdirectory at least. The path generation was changed, it's now only the composite of the namespaces without the outdirectory. So if the info is in the global namespace the path would be empty and the old check wouldn't work as expected. A new attribute has been added to the Reference struct that indicates if the info's parent is the global namespace. Paths generation now fails if the path is empty and if the info is not in the global namespace. Differential Revision: https://reviews.llvm.org/D64958 llvm-svn: 367958
* [clang-doc] Add option for user provided stylesheetsDiego Astiazaran2019-07-251-1/+1
| | | | | | | | | | An option has been added to clang-doc to provide a list of css stylesheets that the user wants to use for the generated html docs. Depends on D64539. Differential Revision: https://reviews.llvm.org/D64938 llvm-svn: 367072
* [clang-doc] Add stylesheet to generated html docsDiego Astiazaran2019-07-251-0/+2
| | | | | | | | A default css stylesheet is included for docs generated in html format. Differential Revision: https://reviews.llvm.org/D64539 llvm-svn: 367056
* [clang-doc] Add html links to referencesJulie Hockett2019-07-121-4/+19
| | | | | | | | | | | | | | | | <a> tags are added for the parents and members of records and return type and params of functions. The link redirects to the reference's info file. The directory path where each info file will be saved is now generated in the serialization phase and stored as an attribute in each Info. Bitcode writer and reader were modified to handle the new attributes. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com). Differential Revision: https://reviews.llvm.org/D63663 llvm-svn: 365937
* [clang-doc] Fix segfault in comment sortingJulie Hockett2019-07-021-6/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D63962 llvm-svn: 364949
* [clang-doc] Handle anonymous namespacesJulie Hockett2019-06-281-0/+2
| | | | | | | | Improves output for anonymous decls, and updates the '--public' flag to exclude everything under an anonymous namespace. Differential Revision: https://reviews.llvm.org/D52847 llvm-svn: 364674
* [clang-doc] De-duplicate comments and locationsJulie Hockett2019-06-281-0/+48
| | | | | | | | | | | | De-duplicate comments and declaration locations in reduce function. When two files include the same header file, this file's content is mapped twice causing comments and locations to be duplicated after the reduce stage. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com). Differential Revision: https://reviews.llvm.org/D62970 llvm-svn: 364670
* [clang-doc] Add basic support for templates and typedefJulie Hockett2019-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In serialize::parseBases(...), when a base record is a template specialization, the specialization was used as the parent. It should be the base template so there is only one file generated for this record. When the specialized template is implicitly declared the reference USR corresponded to the GlobalNamespace's USR, this will now be the base template's USR. More information about templates will be added later. In serialize::emiInfo(RecorDecl*, ...), typedef records were not handled and the name was empty. This is now handled and a IsTypeDef attribute is added to RecordInfo struct. In serialize::emitInfo(CXXMethodDecl*, ...), template specialization is handled like in serialize::parseBases(...). Bitcode writer and reader are modified to handle the new attribute of RecordInfo. Submitted on behalf of Diego Astiazarán (diegoaat97@gmail.com) Differential Revision: https://reviews.llvm.org/D63367 llvm-svn: 364222
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Reland "Implement a (simple) Markdown generator"Julie Hockett2018-09-111-7/+8
| | | | | | | | Relanding with fixes to tests for the failing bots. Differential Revision: https://reviews.llvm.org/D43424 llvm-svn: 341955
* [clang-doc] Fix memory leaksJulie Hockett2018-08-241-0/+2
| | | | | | | | Adds a virtual destructor to the base Info class. Differential Revision: https://reviews.llvm.org/D51137 llvm-svn: 340620
* Revert "Implement a (simple) Markdown generator"Julie Hockett2018-08-161-8/+7
| | | | | | | This reverts commit r339948, as it's breaking a few bots in ways that I can't reproduce right now. llvm-svn: 339966
* Implement a (simple) Markdown generatorJulie Hockett2018-08-161-7/+8
| | | | | | | | | | | | | | | 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
* Reland "[clang-doc] Refactoring mapper to map by scope"Julie Hockett2018-08-021-0/+37
| | | | | | | | | | | | | | | 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
* Revert "[clang-doc] Refactoring mapper to map by scope"Julie Hockett2018-08-021-37/+0
| | | | | | This reverts commit r338738 as it's breaking the bots. llvm-svn: 338748
* [clang-doc] Refactoring mapper to map by scopeJulie Hockett2018-08-021-0/+37
| | | | | | | | | | | 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
* [clang-doc] Adding PublicOnly flagJulie Hockett2018-07-201-0/+6
| | | | | | | | | | | 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
* [clang-doc] Implement a YAML generatorJulie Hockett2018-06-061-4/+24
| | | | | | | | | 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
* [clang-doc] Implement reducer portion of the frontend frameworkJulie Hockett2018-06-041-12/+48
| | | | | | | | | | | | | | | | | | 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
* [clang-doc] Attaching a name to reference dataJulie Hockett2018-05-041-33/+38
| | | | | | | | | | 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
* [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-221-0/+184
| | | | | | Fixed windows release build tests. llvm-svn: 328270
* Revert "[clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework""Julie Hockett2018-03-221-184/+0
| | | | | | | This reverts commit r328150 until we can fix the test that are failing on the Windows release build. llvm-svn: 328172
* [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-211-0/+184
| | | | | | Fixing the the failing Windows tests. llvm-svn: 328150
* Revert "Reland "[clang-doc] Setup clang-doc frontend framework""Julie Hockett2018-03-121-184/+0
| | | | | | | This reverts commit r327295 since it was causing the Windows bots to fail. llvm-svn: 327346
* Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-121-0/+184
| | | | | | | There was a missing newline in the docs, and a static_assert that needed to be a normal assert. llvm-svn: 327295
* Revert "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-091-184/+0
| | | | | | | This reverts commit r327102, since it was breaking the linux-abi-test on x86. llvm-svn: 327103
* [clang-doc] Setup clang-doc frontend frameworkJulie Hockett2018-03-091-0/+184
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
OpenPOWER on IntegriCloud