27 #include "llvm/Option/OptTable.h"
28 #include "llvm/Option/Option.h"
29 #include "llvm/Support/DynamicLibrary.h"
30 #include "llvm/Support/ErrorHandling.h"
31 using namespace clang;
32 using namespace llvm::opt;
35 using namespace clang::frontend;
36 StringRef
Action(
"unknown");
63 for (FrontendPluginRegistry::iterator it =
64 FrontendPluginRegistry::begin(), ie = FrontendPluginRegistry::end();
67 std::unique_ptr<PluginASTAction>
P(it->instantiate());
89 #ifdef CLANG_ENABLE_OBJC_REWRITER
94 #ifdef CLANG_ENABLE_ARCMT
99 #ifdef CLANG_ENABLE_STATIC_ANALYZER
107 #if !defined(CLANG_ENABLE_ARCMT) || !defined(CLANG_ENABLE_STATIC_ANALYZER) \
108 || !defined(CLANG_ENABLE_OBJC_REWRITER)
112 llvm_unreachable(
"Invalid program action!");
128 #ifdef CLANG_ENABLE_ARCMT
168 Opts->PrintHelp(llvm::outs(),
"clang -cc1",
169 "LLVM 'Clang' Compiler: http://clang.llvm.org",
178 llvm::cl::PrintVersionMessage();
187 if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &
Error))
198 auto Args = llvm::make_unique<const char*[]>(NumArgs + 2);
199 Args[0] =
"clang (LLVM option parsing)";
200 for (
unsigned i = 0; i != NumArgs; ++i)
202 Args[NumArgs + 1] =
nullptr;
203 llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());
206 #ifdef CLANG_ENABLE_STATIC_ANALYZER
Expand macros but not #includes.
Generate pre-compiled module.
Parse and perform semantic analysis.
Dump information about the given module file, to be used for basic debugging and discovery.
Abstract base class for actions which can be performed by the frontend.
Parse ASTs and print them.
bool hasErrorOccurred() const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Migrates to modern ObjC syntax.
std::vector< std::string > PluginArgs
Args to pass to the plugin.
Parse and apply any fixits to the source.
Translate input source into HTML.
std::vector< std::string > ASTMergeFiles
The list of AST files to merge.
Print DeclContext and their Decls.
Generate LLVM IR, but do not emit anything.
FrontendOptions & getFrontendOpts()
PreprocessorOutputOptions & getPreprocessorOutputOpts()
AnalyzerOptionsRef getAnalyzerOpts()
unsigned FixAndRecompile
Apply fixes and recompile.
Dump out preprocessed tokens.
std::vector< std::string > Plugins
The list of plugins to load.
unsigned RewriteIncludes
Preprocess include directives only.
Only execute frontend initialization.
Print the "preamble" of the input file.
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
unsigned ARCMTMigrateEmitARCErrors
bool ExecuteAction(FrontendAction &Act)
Frontend action adaptor that merges ASTs together.
Generate machine code, but don't emit anything.
Emits changes to temporary files and uses them for the original frontend action.
Parse ASTs and view them in Graphviz.
Parse ASTs and list Decl nodes.
static FrontendAction * CreateFrontendBaseAction(CompilerInstance &CI)
Load and verify that a PCH file is usable.
unsigned ShowVersion
Show the -version text.
unsigned ShowHelp
Show the -help text.
void printCheckerHelp(raw_ostream &OS, ArrayRef< std::string > plugins)
frontend::ActionKind ProgramAction
The frontend action to perform.
std::string ARCMTMigrateReportOut
enum clang::FrontendOptions::@156 ARCMTAction
FrontendOptions - Options for controlling the behavior of the frontend.
void BuryPointer(const void *Ptr)
Parse ASTs and dump them.
bool ExecuteCompilerInvocation(CompilerInstance *Clang)
llvm::opt::OptTable * createDriverOptTable()
unsigned DisableFree
Disable memory freeing on exit.
Generate pre-compiled header.
std::string ActionName
The name of the action to run when using a plugin action.
Run one or more source code analyses.
std::vector< std::string > LLVMArgs
A list of arguments to forward to LLVM's option processing; this should only be used for debugging an...
Dump information about a module file.
Generate pre-tokenized header.
static FrontendAction * CreateFrontendAction(CompilerInstance &CI)