clang-tools  7.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/StandaloneExecution.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/APFloat.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 { 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 > DumpMapperResult ("dump-mapper", llvm::cl::desc("Dump mapper results to bitcode file."), llvm::cl::init(false), llvm::cl::cat(ClangDocCategory))
 
static llvm::cl::opt< bool > DumpIntermediateResult ("dump-intermediate", llvm::cl::desc("Dump intermediate results to bitcode file."), llvm::cl::init(false), 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< OutputFormatTyFormatEnum ("format", llvm::cl::desc("Format for outputted docs."), llvm::cl::values(clEnumVal(yaml, "Documentation in YAML format.")), llvm::cl::init(yaml), 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))
 
bool CreateDirectory (const Twine &DirName, bool ClearDirectory=false)
 
bool DumpResultToFile (const Twine &DirName, const Twine &FileName, StringRef Buffer, bool ClearDirectory=false)
 
llvm::Expected< llvm::SmallString< 128 > > getPath (StringRef Root, StringRef Ext, StringRef Name, llvm::SmallVectorImpl< doc::Reference > &Namespaces)
 
std::string getFormatString (OutputFormatTy Ty)
 
int main (int argc, const char **argv)
 

Enumeration Type Documentation

◆ OutputFormatTy

Enumerator
yaml 

Definition at line 71 of file ClangDocMain.cpp.

Function Documentation

◆ 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 85 of file ClangDocMain.cpp.

Referenced by DumpResultToFile(), and getPath().

◆ 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().

◆ DumpIntermediateResult()

static llvm::cl::opt<bool> DumpIntermediateResult ( "dump-intermediate"  ,
llvm::cl::desc("Dump intermediate results to bitcode file.")  ,
llvm::cl::init(false)  ,
llvm::cl::cat(ClangDocCategory  
)
static

Referenced by main().

◆ DumpMapperResult()

static llvm::cl::opt<bool> DumpMapperResult ( "dump-mapper"  ,
llvm::cl::desc("Dump mapper results to bitcode file.")  ,
llvm::cl::init(false)  ,
llvm::cl::cat(ClangDocCategory  
)
static

Referenced by main().

◆ DumpResultToFile()

bool DumpResultToFile ( const Twine &  DirName,
const Twine &  FileName,
StringRef  Buffer,
bool  ClearDirectory = false 
)

Definition at line 104 of file ClangDocMain.cpp.

References CreateDirectory(), and OutDirectory().

Referenced by main().

◆ FormatEnum()

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

Referenced by main().

◆ getFormatString()

std::string getFormatString ( OutputFormatTy  Ty)

Definition at line 141 of file ClangDocMain.cpp.

References yaml.

Referenced by main().

◆ getPath()

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

Definition at line 125 of file ClangDocMain.cpp.

References CreateDirectory(), and Path.

Referenced by main().

◆ main()

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

◆ 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

Referenced by DumpResultToFile(), and main().

◆ 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().