clang API Documentation
#include <PreprocessorOptions.h>
Classes | |
class | FailedModulesSet |
Records the set of modules. More... | |
Public Member Functions | |
PreprocessorOptions () | |
void | addMacroDef (StringRef Name) |
void | addMacroUndef (StringRef Name) |
void | addRemappedFile (StringRef From, StringRef To) |
void | addRemappedFile (StringRef From, llvm::MemoryBuffer *To) |
void | clearRemappedFiles () |
void | resetNonModularOptions () |
Reset any options that are not considered when building a module. | |
Public Attributes | |
std::vector< std::pair < std::string, bool > > | Macros |
std::vector< std::string > | Includes |
std::vector< std::string > | MacroIncludes |
unsigned | UsePredefines: 1 |
Initialize the preprocessor with the compiler and target specific predefines. | |
unsigned | DetailedRecord: 1 |
Whether we should maintain a detailed record of all macro definitions and expansions. | |
std::string | ImplicitPCHInclude |
The implicit PCH included at the start of the translation unit, or empty. | |
std::vector< std::string > | ChainedIncludes |
Headers that will be converted to chained PCHs in memory. | |
bool | DisablePCHValidation |
When true, disables most of the normal validation performed on precompiled headers. | |
bool | AllowPCHWithCompilerErrors |
When true, a PCH with compiler errors will not be rejected. | |
bool | DumpDeserializedPCHDecls |
Dump declarations that are deserialized from PCH, for testing. | |
std::set< std::string > | DeserializedPCHDeclsToErrorOn |
This is a set of names for decls that we do not want to be deserialized, and we emit an error if they are; for testing purposes. | |
std::pair< unsigned, bool > | PrecompiledPreambleBytes |
If non-zero, the implicit PCH include is actually a precompiled preamble that covers this number of bytes in the main source file. | |
std::string | ImplicitPTHInclude |
std::string | TokenCache |
If given, a PTH cache file to use for speeding up header parsing. | |
bool | RemappedFilesKeepOriginalName |
True if the SourceManager should report the original file name for contents of files that were remapped to other files. Defaults to true. | |
std::vector< std::pair < std::string, std::string > > | RemappedFiles |
The set of file remappings, which take existing files on the system (the first part of each pair) and gives them the contents of other files on the system (the second part of each pair). | |
std::vector< std::pair < std::string, llvm::MemoryBuffer * > > | RemappedFileBuffers |
The set of file-to-buffer remappings, which take existing files on the system (the first part of each pair) and gives them the contents of the specified memory buffer (the second part of each pair). | |
bool | RetainRemappedFileBuffers |
Whether the compiler instance should retain (i.e., not free) the buffers associated with remapped files. | |
ObjCXXARCStandardLibraryKind | ObjCXXARCStandardLibrary |
The Objective-C++ ARC standard library that we should support, by providing appropriate definitions to retrofit the standard library with support for lifetime-qualified pointers. | |
IntrusiveRefCntPtr < FailedModulesSet > | FailedModules |
The set of modules that failed to build. |
PreprocessorOptions - This class is used for passing the various options used in preprocessor initialization to InitializePreprocessor().
Definition at line 44 of file PreprocessorOptions.h.
clang::PreprocessorOptions::PreprocessorOptions | ( | ) | [inline] |
Definition at line 143 of file PreprocessorOptions.h.
void clang::PreprocessorOptions::addMacroDef | ( | StringRef | Name | ) | [inline] |
Definition at line 152 of file PreprocessorOptions.h.
References Macros.
Referenced by ParsePreprocessorArgs().
void clang::PreprocessorOptions::addMacroUndef | ( | StringRef | Name | ) | [inline] |
Definition at line 155 of file PreprocessorOptions.h.
References Macros.
Referenced by ParsePreprocessorArgs().
void clang::PreprocessorOptions::addRemappedFile | ( | StringRef | From, |
StringRef | To | ||
) | [inline] |
Definition at line 158 of file PreprocessorOptions.h.
References RemappedFiles.
Referenced by clang::arcmt::FileRemapper::applyMappings(), clang::ASTUnit::CodeComplete(), clang::ASTUnit::LoadFromASTFile(), ParsePreprocessorArgs(), and clang::ASTUnit::Reparse().
void clang::PreprocessorOptions::addRemappedFile | ( | StringRef | From, |
llvm::MemoryBuffer * | To | ||
) | [inline] |
Definition at line 162 of file PreprocessorOptions.h.
References RemappedFileBuffers.
void clang::PreprocessorOptions::clearRemappedFiles | ( | ) | [inline] |
Definition at line 166 of file PreprocessorOptions.h.
References RemappedFileBuffers, and RemappedFiles.
Referenced by clang::ASTUnit::CodeComplete(), and clang::ASTUnit::Reparse().
void clang::PreprocessorOptions::resetNonModularOptions | ( | ) | [inline] |
Reset any options that are not considered when building a module.
Definition at line 173 of file PreprocessorOptions.h.
References ChainedIncludes, DumpDeserializedPCHDecls, ImplicitPCHInclude, ImplicitPTHInclude, Includes, MacroIncludes, PrecompiledPreambleBytes, RetainRemappedFileBuffers, and TokenCache.
Referenced by compileModuleImpl().
When true, a PCH with compiler errors will not be rejected.
Definition at line 69 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), and clang::ASTUnit::LoadFromCommandLine().
std::vector<std::string> clang::PreprocessorOptions::ChainedIncludes |
Headers that will be converted to chained PCHs in memory.
Definition at line 62 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::createChainedIncludesSource(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::set<std::string> clang::PreprocessorOptions::DeserializedPCHDeclsToErrorOn |
This is a set of names for decls that we do not want to be deserialized, and we emit an error if they are; for testing purposes.
Definition at line 76 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), and ParsePreprocessorArgs().
Whether we should maintain a detailed record of all macro definitions and expansions.
Definition at line 56 of file PreprocessorOptions.h.
Referenced by checkPreprocessorOptions(), clang::ASTUnit::CodeComplete(), clang::CompilerInstance::createPreprocessor(), clang::CompilerInvocation::getModuleHash(), and ParsePreprocessorArgs().
When true, disables most of the normal validation performed on precompiled headers.
Definition at line 66 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::ASTUnit::CodeComplete(), clang::CompilerInstance::createModuleManager(), and ParsePreprocessorArgs().
Dump declarations that are deserialized from PCH, for testing.
Definition at line 72 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), ParsePreprocessorArgs(), and resetNonModularOptions().
IntrusiveRefCntPtr<FailedModulesSet> clang::PreprocessorOptions::FailedModules |
The set of modules that failed to build.
This pointer will be shared among all of the compiler instances created to (re)build modules, so that once a module fails to build anywhere, other instances will see that the module has failed and won't try to build it again.
Definition at line 140 of file PreprocessorOptions.h.
Referenced by compileModuleImpl(), and clang::CompilerInstance::loadModule().
std::string clang::PreprocessorOptions::ImplicitPCHInclude |
The implicit PCH included at the start of the translation unit, or empty.
Definition at line 59 of file PreprocessorOptions.h.
Referenced by clang::FrontendAction::BeginSourceFile(), checkPreprocessorOptions(), clang::ASTUnit::CodeComplete(), createInvocationForMigration(), clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::string clang::PreprocessorOptions::ImplicitPTHInclude |
The implicit PTH input included at the start of the translation unit, or empty.
Definition at line 87 of file PreprocessorOptions.h.
Referenced by clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::vector<std::string> clang::PreprocessorOptions::Includes |
Definition at line 47 of file PreprocessorOptions.h.
Referenced by checkPreprocessorOptions(), createInvocationForMigration(), clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::vector<std::string> clang::PreprocessorOptions::MacroIncludes |
Definition at line 48 of file PreprocessorOptions.h.
Referenced by checkPreprocessorOptions(), clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::vector<std::pair<std::string, bool> > clang::PreprocessorOptions::Macros |
Definition at line 46 of file PreprocessorOptions.h.
Referenced by addMacroDef(), addMacroUndef(), collectMacroDefinitions(), compileModuleImpl(), and clang::InitializePreprocessor().
The Objective-C++ ARC standard library that we should support, by providing appropriate definitions to retrofit the standard library with support for lifetime-qualified pointers.
Definition at line 118 of file PreprocessorOptions.h.
Referenced by clang::InitializePreprocessor(), and ParsePreprocessorArgs().
If non-zero, the implicit PCH include is actually a precompiled preamble that covers this number of bytes in the main source file.
The boolean indicates whether the preamble ends at the start of a new line.
Definition at line 83 of file PreprocessorOptions.h.
Referenced by clang::ASTUnit::CodeComplete(), clang::CompilerInstance::createPCHExternalASTSource(), clang::VerifyPCHAction::ExecuteAction(), clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
std::vector<std::pair<std::string, llvm::MemoryBuffer *> > clang::PreprocessorOptions::RemappedFileBuffers |
The set of file-to-buffer remappings, which take existing files on the system (the first part of each pair) and gives them the contents of the specified memory buffer (the second part of each pair).
Definition at line 105 of file PreprocessorOptions.h.
Referenced by addRemappedFile(), clearRemappedFiles(), InitializeFileRemapping(), clang::ASTUnit::Reparse(), and clang::ASTUnit::~ASTUnit().
std::vector<std::pair<std::string, std::string> > clang::PreprocessorOptions::RemappedFiles |
The set of file remappings, which take existing files on the system (the first part of each pair) and gives them the contents of other files on the system (the second part of each pair).
Definition at line 100 of file PreprocessorOptions.h.
Referenced by addRemappedFile(), clang::FixItRecompile::BeginInvocation(), clearRemappedFiles(), clang::arcmt::getFileRemappings(), and InitializeFileRemapping().
True if the SourceManager should report the original file name for contents of files that were remapped to other files. Defaults to true.
Definition at line 94 of file PreprocessorOptions.h.
Referenced by clang::FixItRecompile::BeginInvocation(), InitializeFileRemapping(), and clang::ASTUnit::LoadFromCommandLine().
Whether the compiler instance should retain (i.e., not free) the buffers associated with remapped files.
This flag defaults to false; it can be set true only through direct manipulation of the compiler invocation object, in cases where the compiler invocation and its buffers will be reused.
Definition at line 113 of file PreprocessorOptions.h.
Referenced by clang::arcmt::FileRemapper::applyMappings(), clang::ASTUnit::CodeComplete(), compileModuleImpl(), InitializeFileRemapping(), clang::ASTUnit::LoadFromCompilerInvocationAction(), and resetNonModularOptions().
std::string clang::PreprocessorOptions::TokenCache |
If given, a PTH cache file to use for speeding up header parsing.
Definition at line 90 of file PreprocessorOptions.h.
Referenced by clang::CompilerInstance::createPreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().
Initialize the preprocessor with the compiler and target specific predefines.
Definition at line 52 of file PreprocessorOptions.h.
Referenced by checkPreprocessorOptions(), clang::CompilerInvocation::getModuleHash(), clang::InitializePreprocessor(), and ParsePreprocessorArgs().