diff options
Diffstat (limited to 'clang/include/clang/Lex/Preprocessor.h')
| -rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index 1bdd2be04c0e..9716196b95c2 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -14,7 +14,6 @@ #ifndef LLVM_CLANG_LEX_PREPROCESSOR_H #define LLVM_CLANG_LEX_PREPROCESSOR_H -#include "clang/Basic/Builtins.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" @@ -81,6 +80,10 @@ class PreprocessorOptions; class ScratchBuffer; class TargetInfo; +namespace Builtin { +class Context; +} + /// Stores token information for comparing actual tokens with /// predefined values. Only handles simple tokens and identifiers. class TokenValue { @@ -239,7 +242,7 @@ class Preprocessor { SelectorTable Selectors; /// Information about builtins. - Builtin::Context BuiltinInfo; + std::unique_ptr<Builtin::Context> BuiltinInfo; /// Tracks all of the pragmas that the client registered /// with this preprocessor. @@ -911,7 +914,7 @@ public: IdentifierTable &getIdentifierTable() { return Identifiers; } const IdentifierTable &getIdentifierTable() const { return Identifiers; } SelectorTable &getSelectorTable() { return Selectors; } - Builtin::Context &getBuiltinInfo() { return BuiltinInfo; } + Builtin::Context &getBuiltinInfo() { return *BuiltinInfo; } llvm::BumpPtrAllocator &getPreprocessorAllocator() { return BP; } void setExternalSource(ExternalPreprocessorSource *Source) { @@ -929,6 +932,12 @@ public: return TheModuleLoader.HadFatalFailure; } + /// Retrieve the number of Directives that have been processed by the + /// Preprocessor. + unsigned getNumDirectives() const { + return NumDirectives; + } + /// True if we are currently preprocessing a #if or #elif directive bool isParsingIfOrElifDirective() const { return ParsingIfOrElifDirective; |
