clang-tools 20.0.0git
Functions
ClangQuery.cpp File Reference
#include "Query.h"
#include "QueryParser.h"
#include "QuerySession.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/LineEditor/LineEditor.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/WithColor.h"
#include <optional>
#include <string>

Go to the source code of this file.

Functions

static cl::extrahelp CommonHelp (CommonOptionsParser::HelpMessage)
 
static cl::OptionCategory ClangQueryCategory ("clang-query options")
 
static cl::opt< bool > UseColor ("use-color", cl::desc(R"(Use colors in detailed AST output. If not set, colors will be used if the terminal connected to standard output supports colors.)"), cl::init(false), cl::cat(ClangQueryCategory))
 
static cl::list< std::string > Commands ("c", cl::desc("Specify command to run"), cl::value_desc("command"), cl::cat(ClangQueryCategory))
 
static cl::list< std::string > CommandFiles ("f", cl::desc("Read commands from file"), cl::value_desc("file"), cl::cat(ClangQueryCategory))
 
static cl::opt< std::string > PreloadFile ("preload", cl::desc("Preload commands from file and start interactive mode"), cl::value_desc("file"), cl::cat(ClangQueryCategory))
 
bool runCommandsInFile (const char *ExeName, std::string const &FileName, QuerySession &QS)
 
int main (int argc, const char **argv)
 

Function Documentation

◆ ClangQueryCategory()

static cl::OptionCategory ClangQueryCategory ( "clang-query options"  )
static

Referenced by main().

◆ CommandFiles()

static cl::list< std::string > CommandFiles ( "f"  ,
cl::desc("Read commands from file")  ,
cl::value_desc("file")  ,
cl::cat(ClangQueryCategory  
)
static

Referenced by main().

◆ Commands()

static cl::list< std::string > Commands ( "c"  ,
cl::desc("Specify command to run")  ,
cl::value_desc("command")  ,
cl::cat(ClangQueryCategory  
)
static

Referenced by main().

◆ CommonHelp()

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

◆ main()

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

◆ PreloadFile()

static cl::opt< std::string > PreloadFile ( "preload"  ,
cl::desc("Preload commands from file and start interactive mode")  ,
cl::value_desc("file")  ,
cl::cat(ClangQueryCategory  
)
static

Referenced by main().

◆ runCommandsInFile()

bool runCommandsInFile ( const char *  ExeName,
std::string const &  FileName,
QuerySession QS 
)

Definition at line 75 of file ClangQuery.cpp.

References FileName, and clang::query::Query::run().

Referenced by main().

◆ UseColor()

static cl::opt< bool > UseColor ( "use-color"  ,
cl::desc(R"(Use colors in detailed AST output. If not set, colorswill be used if the terminal connected tostandard output supports colors.)")  ,
cl::init(false)  ,
cl::cat(ClangQueryCategory  
)
static

Referenced by main().