class PreprocessorOptions

Declaration

class PreprocessorOptions { /* full declaration omitted */ };

Description

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

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:65

Member Variables

public std::vector<std::pair<std::string, bool>> Macros
public std::vector<std::string> Includes
public std::vector<std::string> MacroIncludes
public bool UsePredefines = true
Initialize the preprocessor with the compiler and target specific predefines.
public bool DetailedRecord = false
Whether we should maintain a detailed record of all macro definitions and expansions.
public bool PCHWithHdrStop = false
When true, we are creating or using a PCH where a #pragma hdrstop is expected to indicate the beginning or end of the PCH.
public bool PCHWithHdrStopCreate = false
When true, we are creating a PCH or creating the PCH object while expecting a #pragma hdrstop to separate the two. Allow for a missing #pragma hdrstop, which generates a PCH for the whole file, and creates an empty PCH object.
public std::string PCHThroughHeader
If non-empty, the filename used in an #include directive in the primary source file (or command-line preinclude) that is used to implement MSVC-style precompiled headers. When creating a PCH, after the #include of this header, the PCH generation stops. When using a PCH, tokens are skipped until after an #include of this header is seen.
public std::string ImplicitPCHInclude
The implicit PCH included at the start of the translation unit, or empty.
public std::vector<std::string> ChainedIncludes
Headers that will be converted to chained PCHs in memory.
public clang::DisableValidationForModuleKind DisablePCHOrModuleValidation = DisableValidationForModuleKind::None
Whether to disable most of the normal validation performed on precompiled headers and module files.
public bool AllowPCHWithCompilerErrors = false
When true, a PCH with compiler errors will not be rejected.
public bool AllowPCHWithDifferentModulesCachePath = false
When true, a PCH with modules cache path different to the current compilation will not be rejected.
public bool DumpDeserializedPCHDecls = false
Dump declarations that are deserialized from PCH, for testing.
public 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.
public std::pair<unsigned int, bool> PrecompiledPreambleBytes
The boolean indicates whether the preamble ends at the start of a new line.
public bool GeneratePreamble = false
When the lexer is done, one of the things that need to be preserved is the conditional #if stack, so the ASTWriter/ASTReader can save/restore it when processing the rest of the file. Similarly, we track an unterminated #pragma assume_nonnull.
public bool WriteCommentListToPCH = true
Whether to write comment locations into the PCH when building it. Reading the comments from the PCH can be a performance hit even if the clients don't use them.
public bool SingleFileParseMode = false
Disables #includes of other files and if there are unresolved identifiers in preprocessor directive conditions it causes all blocks to be parsed so that the client can get the maximum amount of information from the parser.
public bool LexEditorPlaceholders = true
When enabled, the preprocessor will construct editor placeholder tokens.
public bool RemappedFilesKeepOriginalName = true
True if the SourceManager should report the original file name for contents of files that were remapped to other files. Defaults to true.
public 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).
public 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).
public bool RetainRemappedFileBuffers = false
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.
public bool RetainExcludedConditionalBlocks = false
When enabled, excluded conditional blocks retain in the main file.
public clang::ObjCXXARCStandardLibraryKind ObjCXXARCStandardLibrary = ARCXX_nolib
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.
public std::shared_ptr<FailedModulesSet> FailedModules
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.
public std::function<Optional<ArrayRef< dependency_directives_scan::Directive>>( FileEntryRef)> DependencyDirectivesForFile
Enables a client to cache the directives for a file and provide them across multiple compiler invocations. FIXME: Allow returning an error.
public bool SetUpStaticAnalyzer = false
Set up preprocessor for RunAnalysis action.
public bool DisablePragmaDebugCrash = false
Prevents intended crashes when using #pragma clang __debug. For testing.

Method Overview

Methods

PreprocessorOptions()

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:224

void addMacroDef(llvm::StringRef Name)

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:226

Parameters

llvm::StringRef Name

void addMacroUndef(llvm::StringRef Name)

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:229

Parameters

llvm::StringRef Name

void addRemappedFile(llvm::StringRef From,
                     llvm::StringRef To)

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:233

Parameters

llvm::StringRef From
llvm::StringRef To

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

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:237

Parameters

llvm::StringRef From
llvm::MemoryBuffer* To

void clearRemappedFiles()

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:241

void resetNonModularOptions()

Description

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

Declared at: clang/include/clang/Lex/PreprocessorOptions.h:248