clang-tools 8.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/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/Path.h"`
`#include "llvm/Support/Process.h"`
`#include "llvm/Support/Signals.h"`
`#include "llvm/Support/raw_ostream.h"`
`#include <string>`
Include dependency graph for ClangDocMain.cpp:

Go to the source code of this file.

## Enumerations
enum | OutputFormatTy { md, yaml }

## Functions
static llvm::cl::extrahelp | CommonHelp (CommonOptionsParser::HelpMessage)
static llvm::cl::OptionCategory | ClangDocCategory ("clang-doc options")
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::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.")), llvm::cl::init(OutputFormatTy::yaml), llvm::cl::cat(ClangDocCategory))
std::string | getFormatString ()
bool | CreateDirectory (const Twine &DirName, bool ClearDirectory=false)
llvm::Expected< llvm::SmallString< 128 > > | getInfoOutputFile (StringRef Root, llvm::SmallVectorImpl< doc::Reference > &Namespaces, StringRef Name, StringRef Ext)
bool | bitcodeResultsToInfos (tooling::ToolResults &Results, llvm::StringMap< std::vector< std::unique_ptr< doc::Info >>> &Output)
int | main (int argc, const char **argv)

## Enumeration Type Documentation

## ◆ OutputFormatTy

enum OutputFormatTy

Enumerator
md |
yaml |

Definition at line 66 of file ClangDocMain.cpp.

## Function Documentation

## ◆ bitcodeResultsToInfos()

bool bitcodeResultsToInfos | ( | tooling::ToolResults & | Results,
|  | llvm::StringMap< std::vector< std::unique_ptr< doc::Info >>> & | Output
| ) |  |

Definition at line 145 of file ClangDocMain.cpp.

## ◆ ClangDocCategory()

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

Referenced by main().

## ◆ CommonHelp()

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

## ◆ CreateDirectory()

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

Definition at line 90 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

Referenced by main().

## ◆ 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.")) | ,
|  | llvm::cl::init(OutputFormatTy::yaml) | ,
|  | llvm::cl::cat(ClangDocCategory) |
| ) |  |
| static

Referenced by getFormatString().

## ◆ getFormatString()

std::string getFormatString | ( |  | ) |

Definition at line 80 of file ClangDocMain.cpp.

References FormatEnum(), md, and yaml.

Referenced by main().

## ◆ getInfoOutputFile()

llvm::Expected<llvm::SmallString<128> > getInfoOutputFile | ( | StringRef | Root,
|  | llvm::SmallVectorImpl< doc::Reference > & | Namespaces,
|  | StringRef | Name,
|  | StringRef | Ext
| ) |  |

Definition at line 124 of file ClangDocMain.cpp.

References CreateDirectory(), and Path.

## ◆ main()

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

Definition at line 167 of file ClangDocMain.cpp.

References ClangDocCategory(), DoxygenOnly(), clang::doc::findGeneratorByName(), getFormatString(), PublicOnly(), and clang::tidy::cppcoreguidelines::toString().

## ◆ 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

## ◆ PublicOnly()

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

Referenced by main().