clang  6.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::FrontendOptions Class Reference

FrontendOptions - Options for controlling the behavior of the frontend. More...

#include "clang/Frontend/FrontendOptions.h"

Collaboration diagram for clang::FrontendOptions:
Collaboration graph
[legend]

Public Types

enum  { ARCMT_None, ARCMT_Check, ARCMT_Modify, ARCMT_Migrate }
 
enum  {
  ObjCMT_None = 0, ObjCMT_Literals = 0x1, ObjCMT_Subscripting = 0x2, ObjCMT_ReadonlyProperty = 0x4,
  ObjCMT_ReadwriteProperty = 0x8, ObjCMT_Property = (ObjCMT_ReadonlyProperty | ObjCMT_ReadwriteProperty), ObjCMT_Annotation = 0x10, ObjCMT_Instancetype = 0x20,
  ObjCMT_NsMacros = 0x40, ObjCMT_ProtocolConformance = 0x80, ObjCMT_AtomicProperty = 0x100, ObjCMT_ReturnsInnerPointerProperty = 0x200,
  ObjCMT_NsAtomicIOSOnlyProperty = 0x400, ObjCMT_DesignatedInitializer = 0x800, ObjCMT_PropertyDotSyntax = 0x1000, ObjCMT_MigrateDecls,
  ObjCMT_MigrateAll
}
 

Public Member Functions

 FrontendOptions ()
 

Static Public Member Functions

static InputKind getInputKindForExtension (StringRef Extension)
 getInputKindForExtension - Return the appropriate input kind for a file extension. More...
 

Public Attributes

unsigned DisableFree: 1
 Disable memory freeing on exit. More...
 
unsigned RelocatablePCH: 1
 When generating PCH files, instruct the AST writer to create relocatable PCH files. More...
 
unsigned ShowHelp: 1
 Show the -help text. More...
 
unsigned ShowStats: 1
 Show frontend performance metrics and statistics. More...
 
unsigned ShowTimers: 1
 Show timers for individual actions. More...
 
unsigned ShowVersion: 1
 Show the -version text. More...
 
unsigned FixWhatYouCan: 1
 Apply fixes even if there are unfixable errors. More...
 
unsigned FixOnlyWarnings: 1
 Apply fixes only for warnings. More...
 
unsigned FixAndRecompile: 1
 Apply fixes and recompile. More...
 
unsigned FixToTemporaries: 1
 Apply fixes to temporary files. More...
 
unsigned ARCMTMigrateEmitARCErrors: 1
 
unsigned SkipFunctionBodies: 1
 Emit ARC errors even if the migrator can fix them. More...
 
unsigned UseGlobalModuleIndex: 1
 Whether we can use the global module index if available. More...
 
unsigned GenerateGlobalModuleIndex: 1
 Whether we can generate the global module index if needed. More...
 
unsigned ASTDumpDecls: 1
 Whether we include declaration dumps in AST dumps. More...
 
unsigned ASTDumpAll: 1
 Whether we deserialize all decls when forming AST dumps. More...
 
unsigned ASTDumpLookups: 1
 Whether we include lookup table dumps in AST dumps. More...
 
unsigned BuildingImplicitModule: 1
 Whether we are performing an implicit module build. More...
 
unsigned ModulesEmbedAllFiles: 1
 Whether we should embed all used files into the PCM file. More...
 
unsigned IncludeTimestamps: 1
 Whether timestamps should be written to the produced PCH file. More...
 
CodeCompleteOptions CodeCompleteOpts
 
enum clang::FrontendOptions:: { ... }  ARCMTAction
 
unsigned ObjCMTAction
 
std::string ObjCMTWhiteListPath
 
std::string MTMigrateDir
 
std::string ARCMTMigrateReportOut
 
std::vector< FrontendInputFileInputs
 The input files and their types. More...
 
std::string OriginalModuleMap
 When the input is a module map, the original module map file from which that map was inferred, if any (for umbrella modules). More...
 
std::string OutputFile
 The output file, if any. More...
 
std::string FixItSuffix
 If given, the new suffix for fix-it rewritten files. More...
 
std::string ASTDumpFilter
 If given, filter dumped AST Decl nodes by this substring. More...
 
ParsedSourceLocation CodeCompletionAt
 If given, enable code completion at the provided location. More...
 
frontend::ActionKind ProgramAction
 The frontend action to perform. More...
 
std::string ActionName
 The name of the action to run when using a plugin action. More...
 
std::unordered_map< std::string, std::vector< std::string > > PluginArgs
 Args to pass to the plugins. More...
 
std::vector< std::string > AddPluginActions
 The list of plugin actions to run in addition to the normal action. More...
 
std::vector< std::string > Plugins
 The list of plugins to load. More...
 
std::vector< std::shared_ptr< ModuleFileExtension > > ModuleFileExtensions
 The list of module file extensions. More...
 
std::vector< std::string > ModuleMapFiles
 The list of module map files to load before processing the input. More...
 
std::vector< std::string > ModuleFiles
 The list of additional prebuilt module files to load before processing the input. More...
 
std::vector< std::string > ModulesEmbedFiles
 The list of files to embed into the compiled module file. More...
 
std::vector< std::string > ASTMergeFiles
 The list of AST files to merge. More...
 
std::vector< std::string > LLVMArgs
 A list of arguments to forward to LLVM's option processing; this should only be used for debugging and experimental features. More...
 
std::string OverrideRecordLayoutsFile
 File name of the file that will provide record layouts (in the format produced by -fdump-record-layouts). More...
 
std::string AuxTriple
 Auxiliary triple for CUDA compilation. More...
 
std::string FindPchSource
 If non-empty, search the pch input file as if it was a header included by this file. More...
 
std::string StatsFile
 Filename to write statistics to. More...
 

Detailed Description

FrontendOptions - Options for controlling the behavior of the frontend.

Definition at line 169 of file FrontendOptions.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ARCMT_None 
ARCMT_Check 
ARCMT_Modify 
ARCMT_Migrate 

Definition at line 211 of file FrontendOptions.h.

◆ anonymous enum

anonymous enum
Enumerator
ObjCMT_None 
ObjCMT_Literals 

Enable migration to modern ObjC literals.

ObjCMT_Subscripting 

Enable migration to modern ObjC subscripting.

ObjCMT_ReadonlyProperty 

Enable migration to modern ObjC readonly property.

ObjCMT_ReadwriteProperty 

Enable migration to modern ObjC readwrite property.

ObjCMT_Property 

Enable migration to modern ObjC property.

ObjCMT_Annotation 

Enable annotation of ObjCMethods of all kinds.

ObjCMT_Instancetype 

Enable migration of ObjC methods to 'instancetype'.

ObjCMT_NsMacros 

Enable migration to NS_ENUM/NS_OPTIONS macros.

ObjCMT_ProtocolConformance 

Enable migration to add conforming protocols.

ObjCMT_AtomicProperty 

prefer 'atomic' property over 'nonatomic'.

ObjCMT_ReturnsInnerPointerProperty 

annotate property with NS_RETURNS_INNER_POINTER

ObjCMT_NsAtomicIOSOnlyProperty 

use NS_NONATOMIC_IOSONLY for property 'atomic' attribute

ObjCMT_DesignatedInitializer 

Enable inferring NS_DESIGNATED_INITIALIZER for ObjC methods.

ObjCMT_PropertyDotSyntax 

Enable converting setter/getter expressions to property-dot syntx.

ObjCMT_MigrateDecls 
ObjCMT_MigrateAll 

Definition at line 218 of file FrontendOptions.h.

Constructor & Destructor Documentation

◆ FrontendOptions()

clang::FrontendOptions::FrontendOptions ( )
inline

Definition at line 331 of file FrontendOptions.h.

Member Function Documentation

◆ getInputKindForExtension()

InputKind FrontendOptions::getInputKindForExtension ( StringRef  Extension)
static

getInputKindForExtension - Return the appropriate input kind for a file extension.

For example, "c" would return InputKind::C.

Returns
The input kind for the extension, or InputKind::Unknown if the extension is not recognized.

Definition at line 14 of file FrontendOptions.cpp.

References clang::InputKind::Asm, clang::InputKind::C, clang::InputKind::CUDA, clang::InputKind::CXX, clang::InputKind::LLVM_IR, clang::InputKind::ObjC, clang::InputKind::ObjCXX, clang::InputKind::OpenCL, clang::InputKind::Precompiled, and clang::InputKind::Unknown.

Referenced by ParseFrontendArgs().

Member Data Documentation

◆ ActionName

std::string clang::FrontendOptions::ActionName

The name of the action to run when using a plugin action.

Definition at line 285 of file FrontendOptions.h.

Referenced by clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ AddPluginActions

std::vector<std::string> clang::FrontendOptions::AddPluginActions

The list of plugin actions to run in addition to the normal action.

Definition at line 291 of file FrontendOptions.h.

Referenced by clang::FrontendAction::getCurrentModule(), and ParseFrontendArgs().

◆ ARCMTAction

enum { ... } clang::FrontendOptions::ARCMTAction

◆ ARCMTMigrateEmitARCErrors

unsigned clang::FrontendOptions::ARCMTMigrateEmitARCErrors

Definition at line 186 of file FrontendOptions.h.

Referenced by CreateFrontendAction(), and ParseFrontendArgs().

◆ ARCMTMigrateReportOut

std::string clang::FrontendOptions::ARCMTMigrateReportOut

Definition at line 260 of file FrontendOptions.h.

Referenced by CreateFrontendAction(), and ParseFrontendArgs().

◆ ASTDumpAll

unsigned clang::FrontendOptions::ASTDumpAll

Whether we deserialize all decls when forming AST dumps.

Definition at line 198 of file FrontendOptions.h.

Referenced by clang::ASTDumpAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ASTDumpDecls

unsigned clang::FrontendOptions::ASTDumpDecls

Whether we include declaration dumps in AST dumps.

Definition at line 196 of file FrontendOptions.h.

Referenced by clang::ASTDumpAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ASTDumpFilter

std::string clang::FrontendOptions::ASTDumpFilter

If given, filter dumped AST Decl nodes by this substring.

Definition at line 276 of file FrontendOptions.h.

Referenced by clang::ASTPrintAction::CreateASTConsumer(), clang::ASTDumpAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ASTDumpLookups

unsigned clang::FrontendOptions::ASTDumpLookups

Whether we include lookup table dumps in AST dumps.

Definition at line 200 of file FrontendOptions.h.

Referenced by clang::ASTDumpAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ASTMergeFiles

std::vector<std::string> clang::FrontendOptions::ASTMergeFiles

The list of AST files to merge.

Definition at line 310 of file FrontendOptions.h.

Referenced by CreateFrontendAction(), and ParseFrontendArgs().

◆ AuxTriple

std::string clang::FrontendOptions::AuxTriple

Auxiliary triple for CUDA compilation.

Definition at line 321 of file FrontendOptions.h.

Referenced by clang::CompilerInvocation::CreateFromArgs(), clang::CompilerInstance::ExecuteAction(), and ParseFrontendArgs().

◆ BuildingImplicitModule

unsigned clang::FrontendOptions::BuildingImplicitModule

Whether we are performing an implicit module build.

Definition at line 202 of file FrontendOptions.h.

◆ CodeCompleteOpts

CodeCompleteOptions clang::FrontendOptions::CodeCompleteOpts

Definition at line 209 of file FrontendOptions.h.

Referenced by clang::ASTUnit::CodeComplete(), and ParseFrontendArgs().

◆ CodeCompletionAt

ParsedSourceLocation clang::FrontendOptions::CodeCompletionAt

If given, enable code completion at the provided location.

Definition at line 279 of file FrontendOptions.h.

Referenced by clang::ASTUnit::CodeComplete(), clang::CompilerInstance::createCodeCompletionConsumer(), clang::ASTFrontendAction::ExecuteAction(), and ParseFrontendArgs().

◆ DisableFree

unsigned clang::FrontendOptions::DisableFree

Disable memory freeing on exit.

Definition at line 171 of file FrontendOptions.h.

Referenced by clang::FrontendAction::EndSourceFile(), clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ FindPchSource

std::string clang::FrontendOptions::FindPchSource

If non-empty, search the pch input file as if it was a header included by this file.

Definition at line 325 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ FixAndRecompile

unsigned clang::FrontendOptions::FixAndRecompile

Apply fixes and recompile.

Definition at line 184 of file FrontendOptions.h.

Referenced by CreateFrontendAction(), and ParseFrontendArgs().

◆ FixItSuffix

std::string clang::FrontendOptions::FixItSuffix

If given, the new suffix for fix-it rewritten files.

Definition at line 273 of file FrontendOptions.h.

Referenced by clang::FixItAction::BeginSourceFileAction(), and ParseFrontendArgs().

◆ FixOnlyWarnings

unsigned clang::FrontendOptions::FixOnlyWarnings

Apply fixes only for warnings.

Definition at line 183 of file FrontendOptions.h.

Referenced by clang::FixItRecompile::BeginInvocation(), and ParseFrontendArgs().

◆ FixToTemporaries

unsigned clang::FrontendOptions::FixToTemporaries

Apply fixes to temporary files.

Definition at line 185 of file FrontendOptions.h.

Referenced by clang::FixItRecompile::BeginInvocation(), and ParseFrontendArgs().

◆ FixWhatYouCan

unsigned clang::FrontendOptions::FixWhatYouCan

Apply fixes even if there are unfixable errors.

Definition at line 181 of file FrontendOptions.h.

Referenced by clang::FixItRecompile::BeginInvocation(), clang::FixItAction::BeginSourceFileAction(), and ParseFrontendArgs().

◆ GenerateGlobalModuleIndex

unsigned clang::FrontendOptions::GenerateGlobalModuleIndex

Whether we can generate the global module index if needed.

Definition at line 194 of file FrontendOptions.h.

Referenced by compileModuleImpl(), ParseFrontendArgs(), and clang::CompilerInstance::shouldBuildGlobalModuleIndex().

◆ IncludeTimestamps

unsigned clang::FrontendOptions::IncludeTimestamps

Whether timestamps should be written to the produced PCH file.

Definition at line 206 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ Inputs

std::vector<FrontendInputFile> clang::FrontendOptions::Inputs

◆ LLVMArgs

std::vector<std::string> clang::FrontendOptions::LLVMArgs

A list of arguments to forward to LLVM's option processing; this should only be used for debugging and experimental features.

Definition at line 314 of file FrontendOptions.h.

Referenced by clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ ModuleFileExtensions

std::vector<std::shared_ptr<ModuleFileExtension> > clang::FrontendOptions::ModuleFileExtensions

The list of module file extensions.

Definition at line 297 of file FrontendOptions.h.

Referenced by clang::VerifyPCHAction::ExecuteAction(), and ParseFrontendArgs().

◆ ModuleFiles

std::vector<std::string> clang::FrontendOptions::ModuleFiles

The list of additional prebuilt module files to load before processing the input.

Definition at line 304 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ ModuleMapFiles

std::vector<std::string> clang::FrontendOptions::ModuleMapFiles

The list of module map files to load before processing the input.

Definition at line 300 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ ModulesEmbedAllFiles

unsigned clang::FrontendOptions::ModulesEmbedAllFiles

Whether we should embed all used files into the PCM file.

Definition at line 204 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ ModulesEmbedFiles

std::vector<std::string> clang::FrontendOptions::ModulesEmbedFiles

The list of files to embed into the compiled module file.

Definition at line 307 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ MTMigrateDir

std::string clang::FrontendOptions::MTMigrateDir

Definition at line 259 of file FrontendOptions.h.

Referenced by CreateFrontendAction(), and ParseFrontendArgs().

◆ ObjCMTAction

unsigned clang::FrontendOptions::ObjCMTAction

◆ ObjCMTWhiteListPath

std::string clang::FrontendOptions::ObjCMTWhiteListPath

◆ OriginalModuleMap

std::string clang::FrontendOptions::OriginalModuleMap

When the input is a module map, the original module map file from which that map was inferred, if any (for umbrella modules).

Definition at line 267 of file FrontendOptions.h.

Referenced by prepareToBuildModule().

◆ OutputFile

std::string clang::FrontendOptions::OutputFile

◆ OverrideRecordLayoutsFile

std::string clang::FrontendOptions::OverrideRecordLayoutsFile

File name of the file that will provide record layouts (in the format produced by -fdump-record-layouts).

Definition at line 318 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ PluginArgs

std::unordered_map<std::string,std::vector<std::string> > clang::FrontendOptions::PluginArgs

Args to pass to the plugins.

Definition at line 288 of file FrontendOptions.h.

Referenced by clang::FrontendAction::getCurrentModule(), and ParseFrontendArgs().

◆ Plugins

std::vector<std::string> clang::FrontendOptions::Plugins

The list of plugins to load.

Definition at line 294 of file FrontendOptions.h.

Referenced by clang::ento::CreateAnalysisConsumer(), clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ ProgramAction

frontend::ActionKind clang::FrontendOptions::ProgramAction

◆ RelocatablePCH

unsigned clang::FrontendOptions::RelocatablePCH

When generating PCH files, instruct the AST writer to create relocatable PCH files.

Definition at line 172 of file FrontendOptions.h.

Referenced by clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::GeneratePCHAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ShowHelp

unsigned clang::FrontendOptions::ShowHelp

Show the -help text.

Definition at line 175 of file FrontendOptions.h.

Referenced by clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ ShowStats

unsigned clang::FrontendOptions::ShowStats

Show frontend performance metrics and statistics.

Definition at line 176 of file FrontendOptions.h.

Referenced by clang::FrontendAction::EndSourceFile(), clang::ASTFrontendAction::ExecuteAction(), and ParseFrontendArgs().

◆ ShowTimers

unsigned clang::FrontendOptions::ShowTimers

Show timers for individual actions.

Definition at line 178 of file FrontendOptions.h.

Referenced by clang::CodeGenAction::CreateASTConsumer(), and ParseFrontendArgs().

◆ ShowVersion

unsigned clang::FrontendOptions::ShowVersion

Show the -version text.

Definition at line 180 of file FrontendOptions.h.

Referenced by clang::ExecuteCompilerInvocation(), and ParseFrontendArgs().

◆ SkipFunctionBodies

unsigned clang::FrontendOptions::SkipFunctionBodies

Emit ARC errors even if the migrator can fix them.

Skip over function bodies to speed up parsing in cases you do not need them (e.g. with code completion).

Definition at line 188 of file FrontendOptions.h.

Referenced by clang::ASTFrontendAction::ExecuteAction().

◆ StatsFile

std::string clang::FrontendOptions::StatsFile

Filename to write statistics to.

Definition at line 328 of file FrontendOptions.h.

Referenced by ParseFrontendArgs().

◆ UseGlobalModuleIndex

unsigned clang::FrontendOptions::UseGlobalModuleIndex

Whether we can use the global module index if available.

Definition at line 192 of file FrontendOptions.h.

Referenced by clang::CompilerInstance::createModuleManager(), clang::CompilerInstance::createPCHExternalASTSource(), and ParseFrontendArgs().


The documentation for this class was generated from the following files: