9#ifndef LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
10#define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
17#include "llvm/ADT/StringRef.h"
18#include "llvm/Support/Compiler.h"
19#include "llvm/Support/MemoryBuffer.h"
178 LLVM_PREFERRED_TYPE(
Format)
180 LLVM_PREFERRED_TYPE(
bool)
181 unsigned Preprocessed : 1;
183 unsigned HeaderUnit : 3;
184 LLVM_PREFERRED_TYPE(
bool)
185 unsigned IsHeader : 1;
191 : Lang(L), Fmt(F), Preprocessed(PP), HeaderUnit(HU), IsHeader(HD) {}
239 std::optional<llvm::MemoryBufferRef> Buffer;
245 bool IsSystem =
false;
250 :
File(
File.str()), Kind(Kind), IsSystem(IsSystem) {}
252 bool IsSystem =
false)
253 : Buffer(Buffer), Kind(Kind), IsSystem(IsSystem) {}
258 bool isEmpty()
const {
return File.empty() && Buffer == std::nullopt; }
260 bool isBuffer()
const {
return Buffer != std::nullopt; }
264 return Kind.getHeaderUnitKind();
282 LLVM_PREFERRED_TYPE(
bool)
287 LLVM_PREFERRED_TYPE(
bool)
291 LLVM_PREFERRED_TYPE(
bool)
295 LLVM_PREFERRED_TYPE(
bool)
298 LLVM_PREFERRED_TYPE(
bool)
302 LLVM_PREFERRED_TYPE(
bool)
306 LLVM_PREFERRED_TYPE(
bool)
310 LLVM_PREFERRED_TYPE(
bool)
314 LLVM_PREFERRED_TYPE(
bool)
318 LLVM_PREFERRED_TYPE(
bool)
322 LLVM_PREFERRED_TYPE(
bool)
326 LLVM_PREFERRED_TYPE(
bool)
330 LLVM_PREFERRED_TYPE(
bool)
334 LLVM_PREFERRED_TYPE(
bool)
339 LLVM_PREFERRED_TYPE(
bool)
343 LLVM_PREFERRED_TYPE(
bool)
347 LLVM_PREFERRED_TYPE(
bool)
351 LLVM_PREFERRED_TYPE(
bool)
355 LLVM_PREFERRED_TYPE(
bool)
359 LLVM_PREFERRED_TYPE(
bool)
363 LLVM_PREFERRED_TYPE(
bool)
367 LLVM_PREFERRED_TYPE(
bool)
371 LLVM_PREFERRED_TYPE(
bool)
375 LLVM_PREFERRED_TYPE(
bool)
379 LLVM_PREFERRED_TYPE(
bool)
383 LLVM_PREFERRED_TYPE(
bool)
387 LLVM_PREFERRED_TYPE(
bool)
391 LLVM_PREFERRED_TYPE(
bool)
395 LLVM_PREFERRED_TYPE(
bool)
399 LLVM_PREFERRED_TYPE(
bool)
403 LLVM_PREFERRED_TYPE(
bool)
407 LLVM_PREFERRED_TYPE(
bool)
411 LLVM_PREFERRED_TYPE(
bool)
415 LLVM_PREFERRED_TYPE(
bool)
419 LLVM_PREFERRED_TYPE(
bool)
585 LLVM_PREFERRED_TYPE(
bool)
Options controlling the behavior of code completion.
FrontendOptions - Options for controlling the behavior of the frontend.
InputKind DashX
The input kind, either specified via -x argument or deduced from the input file name.
unsigned BuildingImplicitModule
Whether we are performing an implicit module build.
unsigned TimeTraceGranularity
Minimum time granularity (in microseconds) traced by time profiler.
std::string ObjCMTAllowListPath
std::vector< std::string > ModuleFiles
The list of additional prebuilt module files to load before processing the input.
unsigned AllowPCMWithCompilerErrors
Output (and read) PCM files regardless of compiler errors.
unsigned SkipFunctionBodies
Skip over function bodies to speed up parsing in cases you do not need them (e.g.
unsigned IncludeTimestamps
Whether timestamps should be written to the produced PCH file.
unsigned EmitSymbolGraphSymbolLabelsForTesting
Whether to emit symbol labels for testing in generated symbol graphs.
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.
unsigned BuildingImplicitModuleUsesLock
Whether to use a filesystem lock when building implicit modules.
unsigned ModulesShareFileManager
Whether to share the FileManager when building modules.
std::string ASTDumpFilter
If given, filter dumped AST Decl nodes by this substring.
unsigned ASTDumpLookups
Whether we include lookup table dumps in AST dumps.
unsigned UseTemporary
Should a temporary file be used during compilation.
CodeCompleteOptions CodeCompleteOpts
unsigned IsSystemModule
When using -emit-module, treat the modulemap as a system module.
unsigned PrintSupportedCPUs
print the supported cpus for the current target
unsigned FixToTemporaries
Apply fixes to temporary files.
unsigned PrintSupportedExtensions
Print the supported extensions for the current target.
unsigned PrintEnabledExtensions
Print the extensions enabled for the current target.
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.
std::string TimeTracePath
Path which stores the output files for -ftime-trace.
unsigned FixAndRecompile
Apply fixes and recompile.
unsigned UseClangIRPipeline
Use Clang IR pipeline to emit code.
unsigned FixOnlyWarnings
Apply fixes only for warnings.
ASTDumpOutputFormat ASTDumpFormat
Specifies the output format of the AST.
std::optional< std::string > AuxTargetCPU
Auxiliary target CPU for CUDA/HIP compilation.
std::string StatsFile
Filename to write statistics to.
std::string OutputFile
The output file, if any.
unsigned ShowStats
Show frontend performance metrics and statistics.
unsigned GenReducedBMI
Whether to generate reduced BMI for C++20 named modules.
std::string ActionName
The name of the action to run when using a plugin action.
std::vector< std::shared_ptr< ModuleFileExtension > > ModuleFileExtensions
The list of module file extensions.
ParsedSourceLocation CodeCompletionAt
If given, enable code completion at the provided location.
@ ObjCMT_Instancetype
Enable migration of ObjC methods to 'instancetype'.
@ ObjCMT_DesignatedInitializer
Enable inferring NS_DESIGNATED_INITIALIZER for ObjC methods.
@ ObjCMT_Annotation
Enable annotation of ObjCMethods of all kinds.
@ ObjCMT_PropertyDotSyntax
Enable converting setter/getter expressions to property-dot syntx.
@ ObjCMT_ProtocolConformance
Enable migration to add conforming protocols.
@ ObjCMT_NsMacros
Enable migration to NS_ENUM/NS_OPTIONS macros.
@ ObjCMT_AtomicProperty
prefer 'atomic' property over 'nonatomic'.
@ ObjCMT_Literals
Enable migration to modern ObjC literals.
@ ObjCMT_ReadonlyProperty
Enable migration to modern ObjC readonly property.
@ ObjCMT_Subscripting
Enable migration to modern ObjC subscripting.
@ ObjCMT_NsAtomicIOSOnlyProperty
use NS_NONATOMIC_IOSONLY for property 'atomic' attribute
@ ObjCMT_Property
Enable migration to modern ObjC property.
@ ObjCMT_ReadwriteProperty
Enable migration to modern ObjC readwrite property.
@ ObjCMT_ReturnsInnerPointerProperty
annotate property with NS_RETURNS_INNER_POINTER
std::string FixItSuffix
If given, the new suffix for fix-it rewritten files.
std::string ARCMTMigrateReportOut
std::string OriginalModuleMap
When the input is a module map, the original module map file from which that map was inferred,...
std::vector< std::string > ModulesEmbedFiles
The list of files to embed into the compiled module file.
unsigned ShowVersion
Show the -version text.
unsigned ARCMTMigrateEmitARCErrors
Emit ARC errors even if the migrator can fix them.
std::string ProductName
The name of the product the input files belong too.
unsigned ModulesEmbedAllFiles
Whether we should embed all used files into the PCM file.
std::string ModuleOutputPath
Output Path for module output file.
std::vector< std::string > AddPluginActions
The list of plugin actions to run in addition to the normal action.
unsigned ASTDumpDeclTypes
Whether we include declaration type dumps in AST dumps.
unsigned FixWhatYouCan
Apply fixes even if there are unfixable errors.
static InputKind getInputKindForExtension(StringRef Extension)
getInputKindForExtension - Return the appropriate input kind for a file extension.
std::string SymbolGraphOutputDir
std::vector< std::string > ASTMergeFiles
The list of AST files to merge.
std::vector< std::string > Plugins
The list of plugins to load.
unsigned ASTDumpAll
Whether we deserialize all decls when forming AST dumps.
unsigned GenerateGlobalModuleIndex
Whether we can generate the global module index if needed.
unsigned TimeTraceVerbose
Make time trace capture verbose event details (e.g.
unsigned RelocatablePCH
When generating PCH files, instruct the AST writer to create relocatable PCH files.
unsigned EmitExtensionSymbolGraphs
Whether to emit additional symbol graphs for extended modules.
unsigned DisableFree
Disable memory freeing on exit.
SmallVector< FrontendInputFile, 0 > Inputs
The input files and their types.
frontend::ActionKind ProgramAction
The frontend action to perform.
std::optional< std::vector< std::string > > AuxTargetFeatures
Auxiliary target features for CUDA/HIP compilation.
unsigned EmitPrettySymbolGraphs
Whether to emit symbol labels for testing in generated symbol graphs.
enum clang::FrontendOptions::@199 ARCMTAction
std::string OverrideRecordLayoutsFile
File name of the file that will provide record layouts (in the format produced by -fdump-record-layou...
std::vector< std::string > ExtractAPIIgnoresFileList
std::string AuxTriple
Auxiliary triple for CUDA/HIP compilation.
unsigned UseGlobalModuleIndex
Whether we can use the global module index if available.
std::vector< std::string > ModuleMapFiles
The list of module map files to load before processing the input.
unsigned ASTDumpDecls
Whether we include declaration dumps in AST dumps.
@ GenerateHeaderUnit
Generate a C++20 header unit module from a header file.
@ VerifyPCH
Load and verify that a PCH file is usable.
@ PrintPreprocessedInput
-E mode.
@ RewriteTest
Rewriter playground.
@ ParseSyntaxOnly
Parse and perform semantic analysis.
@ TemplightDump
Dump template instantiations.
@ GenerateModuleInterface
Generate pre-compiled module from a standard C++ module interface unit.
@ EmitLLVM
Emit a .ll file.
@ PrintPreamble
Print the "preamble" of the input file.
@ MigrateSource
Run migrator.
@ InitOnly
Only execute frontend initialization.
@ ASTView
Parse ASTs and view them in Graphviz.
@ PluginAction
Run a plugin action,.
@ DumpRawTokens
Dump out raw tokens.
@ PrintDependencyDirectivesSourceMinimizerOutput
Print the output of the dependency directives source minimizer.
@ RewriteObjC
ObjC->C Rewriter.
@ RunPreprocessorOnly
Just lex, no output.
@ ModuleFileInfo
Dump information about a module file.
@ EmitCIR
Emit a .cir file.
@ DumpCompilerOptions
Dump the compiler configuration.
@ RunAnalysis
Run one or more source code analyses.
@ ASTPrint
Parse ASTs and print them.
@ GenerateReducedModuleInterface
Generate reduced module interface for a standard C++ module interface unit.
@ GenerateInterfaceStubs
Generate Interface Stub Files.
@ ASTDump
Parse ASTs and dump them.
@ DumpTokens
Dump out preprocessed tokens.
@ FixIt
Parse and apply any fixits to the source.
@ EmitAssembly
Emit a .s file.
@ EmitCodeGenOnly
Generate machine code, but don't emit anything.
@ RewriteMacros
Expand macros but not #includes.
@ EmitHTML
Translate input source into HTML.
@ GeneratePCH
Generate pre-compiled header.
@ EmitLLVMOnly
Generate LLVM IR, but do not emit anything.
@ GenerateModule
Generate pre-compiled module from a module map.
@ ASTDeclList
Parse ASTs and list Decl nodes.
The JSON file list parser is used to communicate input to InstallAPI.
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
Language
The language for the input, used to select and validate the language standard and possible actions.
Diagnostic wrappers for TextAPI types for error reporting.
A source location that has been parsed on the command line.