clang  3.7.0
Classes | Public Member Functions | Public Attributes | List of all members
clang::PreprocessorOptions Class Reference

#include <PreprocessorOptions.h>

Inheritance diagram for clang::PreprocessorOptions:
[legend]
Collaboration diagram for clang::PreprocessorOptions:
[legend]

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. More...
 

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. More...
 
unsigned DetailedRecord: 1
 Whether we should maintain a detailed record of all macro definitions and expansions. More...
 
std::string ImplicitPCHInclude
 The implicit PCH included at the start of the translation unit, or empty. More...
 
std::vector< std::string > ChainedIncludes
 Headers that will be converted to chained PCHs in memory. More...
 
bool DisablePCHValidation
 When true, disables most of the normal validation performed on precompiled headers. More...
 
bool AllowPCHWithCompilerErrors
 When true, a PCH with compiler errors will not be rejected. More...
 
bool DumpDeserializedPCHDecls
 Dump declarations that are deserialized from PCH, for testing. More...
 
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. More...
 
std::pair< unsigned, boolPrecompiledPreambleBytes
 If non-zero, the implicit PCH include is actually a precompiled preamble that covers this number of bytes in the main source file. More...
 
std::string ImplicitPTHInclude
 
std::string TokenCache
 If given, a PTH cache file to use for speeding up header parsing. More...
 
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. More...
 
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). More...
 
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). More...
 
bool RetainRemappedFileBuffers
 Whether the compiler instance should retain (i.e., not free) the buffers associated with remapped files. More...
 
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. More...
 
IntrusiveRefCntPtr
< FailedModulesSet
FailedModules
 The set of modules that failed to build. More...
 

Detailed Description

PreprocessorOptions - This class is used for passing the various options used in preprocessor initialization to InitializePreprocessor().

Definition at line 44 of file PreprocessorOptions.h.

Constructor & Destructor Documentation

clang::PreprocessorOptions::PreprocessorOptions ( )
inline

Definition at line 143 of file PreprocessorOptions.h.

Member Function Documentation

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 153 of file PreprocessorOptions.h.

References Macros.

Referenced by ParsePreprocessorArgs().

void clang::PreprocessorOptions::addRemappedFile ( StringRef  From,
StringRef  To 
)
inline
void clang::PreprocessorOptions::addRemappedFile ( StringRef  From,
llvm::MemoryBuffer *  To 
)
inline

Definition at line 158 of file PreprocessorOptions.h.

References RemappedFileBuffers.

void clang::PreprocessorOptions::clearRemappedFiles ( )
inline
void clang::PreprocessorOptions::resetNonModularOptions ( )
inline

Reset any options that are not considered when building a module.

Definition at line 169 of file PreprocessorOptions.h.

References ChainedIncludes, DumpDeserializedPCHDecls, ImplicitPCHInclude, ImplicitPTHInclude, Includes, MacroIncludes, PrecompiledPreambleBytes, RetainRemappedFileBuffers, and TokenCache.

Referenced by compileModuleImpl().

Member Data Documentation

bool clang::PreprocessorOptions::AllowPCHWithCompilerErrors

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().

unsigned clang::PreprocessorOptions::DetailedRecord

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().

bool clang::PreprocessorOptions::DisablePCHValidation

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().

bool clang::PreprocessorOptions::DumpDeserializedPCHDecls

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
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
std::vector<std::string> clang::PreprocessorOptions::MacroIncludes
std::vector<std::pair<std::string, bool> > clang::PreprocessorOptions::Macros
ObjCXXARCStandardLibraryKind clang::PreprocessorOptions::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.

Definition at line 118 of file PreprocessorOptions.h.

Referenced by clang::InitializePreprocessor(), and ParsePreprocessorArgs().

std::pair<unsigned, bool> clang::PreprocessorOptions::PrecompiledPreambleBytes

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().

bool clang::PreprocessorOptions::RemappedFilesKeepOriginalName

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().

bool clang::PreprocessorOptions::RetainRemappedFileBuffers

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().

unsigned clang::PreprocessorOptions::UsePredefines

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().


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