;
43staticstd::unique_ptr<FrontendAction>
46StringRef Action(
"unknown");
51 boolEmitsCIR = Act == EmitCIR;
53 if(!UseCIR && EmitsCIR)
54llvm::report_fatal_error(
"-emit-cir and only valid when using -fclangir");
57 caseASTDeclList:
returnstd::make_unique<ASTDeclListAction>();
58 caseASTDump:
returnstd::make_unique<ASTDumpAction>();
59 caseASTPrint:
returnstd::make_unique<ASTPrintAction>();
60 caseASTView:
returnstd::make_unique<ASTViewAction>();
61 caseDumpCompilerOptions:
62 returnstd::make_unique<DumpCompilerOptionsAction>();
63 caseDumpRawTokens:
returnstd::make_unique<DumpRawTokensAction>();
64 caseDumpTokens:
returnstd::make_unique<DumpTokensAction>();
65 caseEmitAssembly:
returnstd::make_unique<EmitAssemblyAction>();
66 caseEmitBC:
returnstd::make_unique<EmitBCAction>();
69 returnstd::make_unique<cir::EmitCIRAction>();
71llvm_unreachable(
"CIR suppport not built into clang");
73 caseEmitHTML:
returnstd::make_unique<HTMLPrintAction>();
77 returnstd::make_unique<cir::EmitLLVMAction>();
79 returnstd::make_unique<EmitLLVMAction>();
81 caseEmitLLVMOnly:
returnstd::make_unique<EmitLLVMOnlyAction>();
82 caseEmitCodeGenOnly:
returnstd::make_unique<EmitCodeGenOnlyAction>();
83 caseEmitObj:
returnstd::make_unique<EmitObjAction>();
85 returnstd::make_unique<ExtractAPIAction>();
86 caseFixIt:
returnstd::make_unique<FixItAction>();
88 returnstd::make_unique<GenerateModuleFromModuleMapAction>();
89 caseGenerateModuleInterface:
90 returnstd::make_unique<GenerateModuleInterfaceAction>();
91 caseGenerateReducedModuleInterface:
92 returnstd::make_unique<GenerateReducedModuleInterfaceAction>();
93 caseGenerateHeaderUnit:
94 returnstd::make_unique<GenerateHeaderUnitAction>();
95 caseGeneratePCH:
returnstd::make_unique<GeneratePCHAction>();
96 caseGenerateInterfaceStubs:
97 returnstd::make_unique<GenerateInterfaceStubsAction>();
98 caseInitOnly:
returnstd::make_unique<InitOnlyAction>();
99 caseParseSyntaxOnly:
returnstd::make_unique<SyntaxOnlyAction>();
100 caseModuleFileInfo:
returnstd::make_unique<DumpModuleInfoAction>();
101 caseVerifyPCH:
returnstd::make_unique<VerifyPCHAction>();
102 caseTemplightDump:
returnstd::make_unique<TemplightDumpAction>();
105 for(
constFrontendPluginRegistry::entry &Plugin :
106FrontendPluginRegistry::entries()) {
108std::unique_ptr<PluginASTAction>
P(Plugin.instantiate());
115 returnstd::move(
P);
124 casePrintPreamble:
returnstd::make_unique<PrintPreambleAction>();
125 casePrintPreprocessedInput: {
128 returnstd::make_unique<RewriteIncludesAction>();
129 returnstd::make_unique<PrintPreprocessedAction>();
132 caseRewriteMacros:
returnstd::make_unique<RewriteMacrosAction>();
133 caseRewriteTest:
returnstd::make_unique<RewriteTestAction>();
134#if CLANG_ENABLE_OBJC_REWRITER 135 caseRewriteObjC:
returnstd::make_unique<RewriteObjCAction>();
137 caseRewriteObjC: Action =
"RewriteObjC";
break;
139#if CLANG_ENABLE_STATIC_ANALYZER 140 caseRunAnalysis:
returnstd::make_unique<ento::AnalysisAction>();
142 caseRunAnalysis: Action =
"RunAnalysis";
break;
144 caseRunPreprocessorOnly:
returnstd::make_unique<PreprocessOnlyAction>();
145 casePrintDependencyDirectivesSourceMinimizerOutput:
146 returnstd::make_unique<PrintDependencyDirectivesSourceMinimizerAction>();
149#if !CLANG_ENABLE_STATIC_ANALYZER || !CLANG_ENABLE_OBJC_REWRITER 153llvm_unreachable(
"Invalid program action!");
157std::unique_ptr<FrontendAction>
167Act = std::make_unique<FixItRecompile>(std::move(Act));
179Act = std::make_unique<WrappingExtractAPIAction>(std::move(Act));
185Act = std::make_unique<ASTMergeAction>(std::move(Act),
195llvm::outs(),
"clang -cc1 [options] file...",
196 "LLVM 'Clang' Compiler: http://clang.llvm.org",
206llvm::cl::PrintVersionMessage();
218 autoArgs = std::make_unique<const char*[]>(NumArgs + 2);
219Args[0] =
"clang (LLVM option parsing)";
220 for(
unsignedi = 0; i != NumArgs; ++i)
222Args[NumArgs + 1] =
nullptr;
223llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args.get());
226#if CLANG_ENABLE_STATIC_ANALYZER 267llvm::BuryPointer(std::move(Act));
Stores options for the analyzer from the command line.
unsigned ShowCheckerOptionDeveloperList
unsigned ShowEnabledCheckerList
unsigned ShowCheckerHelpAlpha
unsigned ShowConfigOptionsList
unsigned ShowCheckerHelpDeveloper
unsigned ShowCheckerOptionList
unsigned ShowCheckerOptionAlphaList
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
AnalyzerOptions & getAnalyzerOpts()
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
PreprocessorOutputOptions & getPreprocessorOutputOpts()
void LoadRequestedPlugins()
Load the list of plugins requested in the FrontendOptions.
FrontendOptions & getFrontendOpts()
bool ExecuteAction(FrontendAction &Act)
ExecuteAction - Execute the provided action against the compiler's CompilerInvocation object.
CodeGenOptions & getCodeGenOpts()
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
bool hasErrorOccurred() const
FrontendOptions - Options for controlling the behavior of the frontend.
unsigned EmitSymbolGraph
Whether to emit symbol graph files as a side effect of compilation.
std::map< std::string, std::vector< std::string > > PluginArgs
Args to pass to the plugins.
std::vector< std::string > LLVMArgs
A list of arguments to forward to LLVM's option processing; this should only be used for debugging an...
unsigned ShowHelp
Show the -help text.
unsigned FixAndRecompile
Apply fixes and recompile.
unsigned UseClangIRPipeline
Use Clang IR pipeline to emit code.
std::string ActionName
The name of the action to run when using a plugin action.
unsigned ShowVersion
Show the -version text.
std::string SymbolGraphOutputDir
std::vector< std::string > ASTMergeFiles
The list of AST files to merge.
unsigned DisableFree
Disable memory freeing on exit.
frontend::ActionKind ProgramAction
The frontend action to perform.
@ ReplaceAction
Replace the main action.
@ CmdlineAfterMainAction
Execute the action after the main action if on the command line.
unsigned RewriteIncludes
Preprocess include directives only.
unsigned RewriteImports
Include contents of transitively-imported modules.
const llvm::opt::OptTable & getDriverOptTable()
void printEnabledCheckerList(llvm::raw_ostream &OS, CompilerInstance &CI)
void printCheckerHelp(llvm::raw_ostream &OS, CompilerInstance &CI)
void printAnalyzerConfigList(llvm::raw_ostream &OS)
void printCheckerConfigList(llvm::raw_ostream &OS, CompilerInstance &CI)
The JSON file list parser is used to communicate input to InstallAPI.
static std::unique_ptr< FrontendAction > CreateFrontendBaseAction(CompilerInstance &CI)
bool ExecuteCompilerInvocation(CompilerInstance *Clang)
ExecuteCompilerInvocation - Execute the given actions described by the compiler invocation object in ...
std::unique_ptr< FrontendAction > CreateFrontendAction(CompilerInstance &CI)
Construct the FrontendAction of a compiler invocation based on the options specified for the compiler...
@ Success
Template argument deduction was successful.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4