summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/Representation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-doc] Use llvm::createStringError and canonicalize error messagesFangrui Song2019-08-281-6/+6
| | | | | | | | | | | | | "Bad block found.\n" -> "bad block found" The lower cased form with no full stop or newline is more common in LLVM tools. Reviewed By: juliehockett Differential Revision: https://reviews.llvm.org/D66783 llvm-svn: 370155
* [clang-doc] Redesign of generated HTML filesDiego Astiazaran2019-08-161-4/+6
| | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | 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-0/+20
| | | | | | | | Implement logic to compare the references of the index case insensitive. Differential revision: https://reviews.llvm.org/D66299 llvm-svn: 369068
* [clang-doc] Fix use of source-root flagDiego Astiazaran2019-08-151-2/+6
| | | | | | | | | | The value, if any, of --source-root flag was not being used. This has been fixed and the logic was moved to the ClangDocContext contructor. Differential revision: https://reviews.llvm.org/D66268 llvm-svn: 369065
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clang-doc] Generate HTML links for children namespaces/recordsDiego Astiazaran2019-08-121-3/+19
| | | | | | | | | | | | | | | | 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-0/+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 index in each info html fileDiego Astiazaran2019-08-061-1/+7
| | | | | | | | | | | | 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] Add html links to referencesJulie Hockett2019-07-121-0/+2
| | | | | | | | | | | | | | | | <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] Handle anonymous namespacesJulie Hockett2019-06-281-0/+33
| | | | | | | | 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/+6
| | | | | | | | | | | | 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
* 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 "[clang-doc] Refactoring mapper to map by scope"Julie Hockett2018-08-021-5/+67
| | | | | | | | | | | | | | | 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-66/+4
| | | | | | This reverts commit r338738 as it's breaking the bots. llvm-svn: 338748
* [clang-doc] Refactoring mapper to map by scopeJulie Hockett2018-08-021-4/+66
| | | | | | | | | | | 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-1/+1
| | | | | | | | | | | 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 reducer portion of the frontend frameworkJulie Hockett2018-06-041-0/+131
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
OpenPOWER on IntegriCloud