clang-tools 10.0.0

Enumerations | Functions
ClangDocMain.cpp File Reference
`#include "BitcodeReader.h"`
`#include "BitcodeWriter.h"`
`#include "ClangDoc.h"`
`#include "Generators.h"`
`#include "Representation.h"`
`#include "clang/AST/AST.h"`
`#include "clang/AST/Decl.h"`
`#include "clang/ASTMatchers/ASTMatchFinder.h"`
`#include "clang/ASTMatchers/ASTMatchersInternal.h"`
`#include "clang/Driver/Options.h"`
`#include "clang/Frontend/FrontendActions.h"`
`#include "clang/Tooling/AllTUsExecution.h"`
`#include "clang/Tooling/CommonOptionsParser.h"`
`#include "clang/Tooling/Execution.h"`
`#include "clang/Tooling/Tooling.h"`
`#include "llvm/ADT/APFloat.h"`
`#include "llvm/Support/CommandLine.h"`
`#include "llvm/Support/Error.h"`
`#include "llvm/Support/FileSystem.h"`
`#include "llvm/Support/Mutex.h"`
`#include "llvm/Support/Path.h"`
`#include "llvm/Support/Process.h"`
`#include "llvm/Support/Signals.h"`
`#include "llvm/Support/ThreadPool.h"`
`#include "llvm/Support/raw_ostream.h"`
`#include <atomic>`
`#include <string>`
Include dependency graph for ClangDocMain.cpp:

Go to the source code of this file.

## Enumerations
enum | OutputFormatTy { md, yaml, html }

## Functions
static llvm::cl::extrahelp | CommonHelp (CommonOptionsParser::HelpMessage)
static llvm::cl::OptionCategory | ClangDocCategory ("clang-doc options")
static llvm::cl::opt< std::string > | ProjectName ("project-name", llvm::cl::desc("Name of project."), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< bool > | IgnoreMappingFailures ("ignore-map-errors", llvm::cl::desc("Continue if files are not mapped correctly."), llvm::cl::init(true), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< std::string > | OutDirectory ("output", llvm::cl::desc("Directory for outputting generated files."), llvm::cl::init("docs"), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< bool > | PublicOnly ("public", llvm::cl::desc("Document only public declarations."), llvm::cl::init(false), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< bool > | DoxygenOnly ("doxygen", llvm::cl::desc("Use only doxygen-style comments to generate docs."), llvm::cl::init(false), llvm::cl::cat(ClangDocCategory))
static llvm::cl::list< std::string > | UserStylesheets ("stylesheets", llvm::cl::CommaSeparated, llvm::cl::desc("CSS stylesheets to extend the default styles."), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< std::string > | SourceRoot ("source-root", llvm::cl::desc(R"( Directory where processed files are stored. Links to definition locations will only be generated if the file is in this dir.)"), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< std::string > | RepositoryUrl ("repository", llvm::cl::desc(R"( URL of repository that hosts code. Used for links to definition locations.)"), llvm::cl::cat(ClangDocCategory))
static llvm::cl::opt< OutputFormatTy > | FormatEnum ("format", llvm::cl::desc("Format for outputted docs."), llvm::cl::values(clEnumValN(OutputFormatTy::yaml, "yaml", "Documentation in YAML format."), clEnumValN(OutputFormatTy::md, "md", "Documentation in MD format."), clEnumValN(OutputFormatTy::html, "html", "Documentation in HTML format.")), llvm::cl::init(OutputFormatTy::yaml), llvm::cl::cat(ClangDocCategory))
std::string | getFormatString ()
std::string | GetExecutablePath (const char *Argv0, void *MainAddr)
bool | CreateDirectory (const Twine &DirName, bool ClearDirectory=false)
llvm::Expected< llvm::SmallString< 128 > > | getInfoOutputFile (StringRef Root, StringRef RelativePath, StringRef Name, StringRef Ext)
int | main (int argc, const char **argv)

## Enumeration Type Documentation

## ◆ OutputFormatTy

enum OutputFormatTy

Enumerator
md |
yaml |
html |

Definition at line 90 of file ClangDocMain.cpp.

## Function Documentation

## ◆ ClangDocCategory()

static llvm::cl::OptionCategory ClangDocCategory | ( | "clang-doc options" |  | ) |
| static

## ◆ CommonHelp()

static llvm::cl::extrahelp CommonHelp | ( | CommonOptionsParser::HelpMessage |  | ) |
| static

## ◆ CreateDirectory()

bool CreateDirectory | ( | const Twine & | DirName,
|  | bool | ClearDirectory = `false`
| ) |  |

Definition at line 128 of file ClangDocMain.cpp.

Referenced by getInfoOutputFile().

## ◆ DoxygenOnly()

static llvm::cl::opt<bool> DoxygenOnly | ( | "doxygen" | ,
|  | llvm::cl::desc("Use only doxygen-style comments to generate docs.") | ,
|  | llvm::cl::init(false) | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ FormatEnum()

static llvm::cl::opt<OutputFormatTy> FormatEnum | ( | "format" | ,
|  | llvm::cl::desc("Format for outputted docs.") | ,
|  | llvm::cl::values(clEnumValN(OutputFormatTy::yaml, "yaml", "Documentation in YAML format."), clEnumValN(OutputFormatTy::md, "md", "Documentation in MD format."), clEnumValN(OutputFormatTy::html, "html", "Documentation in HTML format.")) | ,
|  | llvm::cl::init(OutputFormatTy::yaml) | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ GetExecutablePath()

std::string GetExecutablePath | ( | const char * | Argv0,
|  | void * | MainAddr
| ) |  |

Definition at line 124 of file ClangDocMain.cpp.

## ◆ getFormatString()

std::string getFormatString | ( |  | ) |

Definition at line 107 of file ClangDocMain.cpp.

## ◆ getInfoOutputFile()

llvm::Expected<llvm::SmallString<128> > getInfoOutputFile | ( | StringRef | Root,
|  | StringRef | RelativePath,
|  | StringRef | Name,
|  | StringRef | Ext
| ) |  |

Definition at line 162 of file ClangDocMain.cpp.

References CreateDirectory(), and Path.

## ◆ IgnoreMappingFailures()

static llvm::cl::opt<bool> IgnoreMappingFailures | ( | "ignore-map-errors" | ,
|  | llvm::cl::desc("Continue if files are not mapped correctly.") | ,
|  | llvm::cl::init(true) | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ main()

int main | ( | int | argc,
|  | const char ** | argv
| ) |  |

Definition at line 176 of file ClangDocMain.cpp.

## ◆ OutDirectory()

static llvm::cl::opt<std::string> OutDirectory | ( | "output" | ,
|  | llvm::cl::desc("Directory for outputting generated files.") | ,
|  | llvm::cl::init("docs") | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ ProjectName()

static llvm::cl::opt<std::string> ProjectName | ( | "project-name" | ,
|  | llvm::cl::desc("Name of project.") | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

Referenced by clang::doc::genFileHeaderNode().

## ◆ PublicOnly()

static llvm::cl::opt<bool> PublicOnly | ( | "public" | ,
|  | llvm::cl::desc("Document only public declarations.") | ,
|  | llvm::cl::init(false) | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ RepositoryUrl()

static llvm::cl::opt<std::string> RepositoryUrl | ( | "repository" | ,
|  | llvm::cl::desc(R"(URL of repository that hosts code.Used for links to definition locations.)") | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

Referenced by clang::doc::writeFileDefinition().

## ◆ SourceRoot()

static llvm::cl::opt<std::string> SourceRoot | ( | "source-root" | ,
|  | llvm::cl::desc(R"(Directory where processed files are stored.Links to definition locations will only begenerated if the file is in this dir.)") | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

## ◆ UserStylesheets()

static llvm::cl::list<std::string> UserStylesheets | ( | "stylesheets" | ,
|  | llvm::cl::CommaSeparated | ,
|  | llvm::cl::desc("CSS stylesheets to extend the default styles.") | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static