clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::PreprocessorOptions Class Reference

#include <PreprocessorOptions.h>

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

List of all members.

Public Types

typedef std::vector< std::pair
< std::string, std::string >
>::iterator 
remapped_file_iterator
typedef std::vector< std::pair
< std::string, std::string >
>::const_iterator 
const_remapped_file_iterator
typedef std::vector< std::pair
< std::string, const
llvm::MemoryBuffer * >
>::iterator 
remapped_file_buffer_iterator
typedef std::vector< std::pair
< std::string, const
llvm::MemoryBuffer * >
>::const_iterator 
const_remapped_file_buffer_iterator

Public Member Functions

remapped_file_iterator remapped_file_begin ()
const_remapped_file_iterator remapped_file_begin () const
remapped_file_iterator remapped_file_end ()
const_remapped_file_iterator remapped_file_end () const
remapped_file_buffer_iterator remapped_file_buffer_begin ()
const_remapped_file_buffer_iterator remapped_file_buffer_begin () const
remapped_file_buffer_iterator remapped_file_buffer_end ()
const_remapped_file_buffer_iterator remapped_file_buffer_end () const
 PreprocessorOptions ()
void addMacroDef (StringRef Name)
void addMacroUndef (StringRef Name)
void addRemappedFile (StringRef From, StringRef To)
remapped_file_iterator eraseRemappedFile (remapped_file_iterator Remapped)
void addRemappedFile (StringRef From, const llvm::MemoryBuffer *To)
remapped_file_buffer_iterator eraseRemappedFile (remapped_file_buffer_iterator Remapped)
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
unsigned DetailedRecord: 1
unsigned DetailedRecordConditionalDirectives: 1
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 DisableStatCache
 When true, disables the use of the stat cache within a precompiled header or AST file.
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, const
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.
SmallVector< std::string, 2 > ModuleBuildPath
 The path of modules being build, which is used to detect cycles in the module dependency graph as modules are being built.

Detailed Description

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

Definition at line 41 of file PreprocessorOptions.h.


Member Typedef Documentation

typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >:: const_iterator clang::PreprocessorOptions::const_remapped_file_buffer_iterator

Definition at line 153 of file PreprocessorOptions.h.

typedef std::vector<std::pair<std::string, std::string> >::const_iterator clang::PreprocessorOptions::const_remapped_file_iterator

Definition at line 136 of file PreprocessorOptions.h.

typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >:: iterator clang::PreprocessorOptions::remapped_file_buffer_iterator

Definition at line 151 of file PreprocessorOptions.h.

typedef std::vector<std::pair<std::string, std::string> >::iterator clang::PreprocessorOptions::remapped_file_iterator

Definition at line 134 of file PreprocessorOptions.h.


Constructor & Destructor Documentation

clang::PreprocessorOptions::PreprocessorOptions ( ) [inline]

Definition at line 168 of file PreprocessorOptions.h.


Member Function Documentation

void clang::PreprocessorOptions::addMacroDef ( StringRef  Name) [inline]

Definition at line 178 of file PreprocessorOptions.h.

References Macros.

Referenced by ParsePreprocessorArgs().

void clang::PreprocessorOptions::addMacroUndef ( StringRef  Name) [inline]

Definition at line 181 of file PreprocessorOptions.h.

References Macros.

Referenced by ParsePreprocessorArgs().

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

Definition at line 192 of file PreprocessorOptions.h.

References RemappedFileBuffers.

void clang::PreprocessorOptions::clearRemappedFiles ( ) [inline]
remapped_file_iterator clang::PreprocessorOptions::eraseRemappedFile ( remapped_file_iterator  Remapped) [inline]

Definition at line 188 of file PreprocessorOptions.h.

References RemappedFiles.

remapped_file_buffer_iterator clang::PreprocessorOptions::eraseRemappedFile ( remapped_file_buffer_iterator  Remapped) [inline]

Definition at line 197 of file PreprocessorOptions.h.

References RemappedFileBuffers.

remapped_file_iterator clang::PreprocessorOptions::remapped_file_begin ( ) [inline]
const_remapped_file_iterator clang::PreprocessorOptions::remapped_file_begin ( ) const [inline]

Definition at line 140 of file PreprocessorOptions.h.

References RemappedFiles.

remapped_file_buffer_iterator clang::PreprocessorOptions::remapped_file_buffer_begin ( ) [inline]
const_remapped_file_buffer_iterator clang::PreprocessorOptions::remapped_file_buffer_begin ( ) const [inline]

Definition at line 157 of file PreprocessorOptions.h.

References RemappedFileBuffers.

remapped_file_buffer_iterator clang::PreprocessorOptions::remapped_file_buffer_end ( ) [inline]
const_remapped_file_buffer_iterator clang::PreprocessorOptions::remapped_file_buffer_end ( ) const [inline]

Definition at line 163 of file PreprocessorOptions.h.

References RemappedFileBuffers.

remapped_file_iterator clang::PreprocessorOptions::remapped_file_end ( ) [inline]
const_remapped_file_iterator clang::PreprocessorOptions::remapped_file_end ( ) const [inline]

Definition at line 146 of file PreprocessorOptions.h.

References RemappedFiles.

void clang::PreprocessorOptions::resetNonModularOptions ( ) [inline]

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

Definition at line 208 of file PreprocessorOptions.h.

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

Referenced by compileModule().


Member Data Documentation

When true, a PCH with compiler errors will not be rejected.

Definition at line 73 of file PreprocessorOptions.h.

Referenced by clang::FrontendAction::BeginSourceFile(), and clang::ASTUnit::LoadFromCommandLine().

Headers that will be converted to chained PCHs in memory.

Definition at line 62 of file PreprocessorOptions.h.

Referenced by clang::FrontendAction::BeginSourceFile(), clang::ChainedIncludesSource::create(), ParsePreprocessorArgs(), PreprocessorOptsToArgs(), and resetNonModularOptions().

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

Referenced by clang::arcmt::MigrateSourceAction::BeginInvocation(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), and clang::CompilerInstance::createPreprocessor().

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::loadModule(), and ParsePreprocessorArgs().

When true, disables the use of the stat cache within a precompiled header or AST file.

Definition at line 70 of file PreprocessorOptions.h.

Referenced by clang::FrontendAction::BeginSourceFile(), clang::ASTUnit::CodeComplete(), clang::CompilerInstance::loadModule(), and clang::ASTUnit::Reparse().

Dump declarations that are deserialized from PCH, for testing.

Definition at line 76 of file PreprocessorOptions.h.

Referenced by clang::FrontendAction::BeginSourceFile(), ParsePreprocessorArgs(), and resetNonModularOptions().

The implicit PCH included at the start of the translation unit, or empty.

Whether in the preprocessing record we should also keep track of locations of conditional directives in non-system files.

Definition at line 59 of file PreprocessorOptions.h.

Referenced by clang::FrontendAction::BeginSourceFile(), clang::ASTUnit::CodeComplete(), createInvocationForMigration(), ParsePreprocessorArgs(), PreprocessorOptsToArgs(), and resetNonModularOptions().

The implicit PTH input included at the start of the translation unit, or empty.

Definition at line 91 of file PreprocessorOptions.h.

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

std::vector<std::string> clang::PreprocessorOptions::Includes
std::vector<std::pair<std::string, bool> > clang::PreprocessorOptions::Macros
SmallVector<std::string, 2> clang::PreprocessorOptions::ModuleBuildPath

The path of modules being build, which is used to detect cycles in the module dependency graph as modules are being built.

There is no way to set this value from the command line. If we ever need to do so (e.g., if on-demand module construction moves out-of-process), we can add a cc1-level option to do so.

Definition at line 131 of file PreprocessorOptions.h.

Referenced by compileModule(), and clang::CompilerInstance::loadModule().

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

Referenced by clang::ASTUnit::CodeComplete(), clang::CompilerInstance::createPCHExternalASTSource(), clang::InitializePreprocessor(), ParsePreprocessorArgs(), and resetNonModularOptions().

std::vector<std::pair<std::string, const 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 110 of file PreprocessorOptions.h.

Referenced by addRemappedFile(), clearRemappedFiles(), eraseRemappedFile(), remapped_file_buffer_begin(), and remapped_file_buffer_end().

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

Referenced by addRemappedFile(), clang::FixItRecompile::BeginInvocation(), clearRemappedFiles(), eraseRemappedFile(), clang::arcmt::getFileRemappings(), PreprocessorOptsToArgs(), remapped_file_begin(), and remapped_file_end().

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

Referenced by clang::arcmt::FileRemapper::applyMappings(), clang::ASTUnit::CodeComplete(), compileModule(), InitializeFileRemapping(), clang::ASTUnit::LoadFromCompilerInvocationAction(), resetNonModularOptions(), and clang::arcmt::FileRemapper::transferMappingsAndClear().

If given, a PTH cache file to use for speeding up header parsing.

Definition at line 94 of file PreprocessorOptions.h.

Referenced by clang::CompilerInstance::createPreprocessor(), ParsePreprocessorArgs(), PreprocessorOptsToArgs(), and resetNonModularOptions().


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