aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Serialization
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-24 20:05:57 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-24 20:05:57 +0000
commita71a7d8a1ce4474e7bdb680658fb58b6caf391d3 (patch)
treedb0dd78703e350fac948b422d8317f58dbc7153c /include/clang/Serialization
parent946fa657a70408719d2cafa542e396b002d61316 (diff)
(De-)serialize the preprocessor options, including macros defined,
-include'd files, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r--include/clang/Serialization/ASTBitCodes.h5
-rw-r--r--include/clang/Serialization/ASTReader.h12
2 files changed, 16 insertions, 1 deletions
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h
index 9c28dc937f..4dba7b5739 100644
--- a/include/clang/Serialization/ASTBitCodes.h
+++ b/include/clang/Serialization/ASTBitCodes.h
@@ -270,7 +270,10 @@ namespace clang {
FILE_SYSTEM_OPTIONS = 9,
/// \brief Record code for the headers search options table.
- HEADER_SEARCH_OPTIONS = 10
+ HEADER_SEARCH_OPTIONS = 10,
+
+ /// \brief Record code for the preprocessor options table.
+ PREPROCESSOR_OPTIONS = 11
};
/// \brief Record types that occur within the input-files block
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index cc01c8b8b0..d285ca504a 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -73,6 +73,7 @@ class MacroDefinition;
class NamedDecl;
class OpaqueValueExpr;
class Preprocessor;
+class PreprocessorOptions;
class Sema;
class SwitchCase;
class ASTDeserializationListener;
@@ -148,6 +149,15 @@ public:
return false;
}
+ /// \brief Receives the preprocessor options.
+ ///
+ /// \returns true to indicate the preprocessor options are invalid, or false
+ /// otherwise.
+ virtual bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
+ bool Complain) {
+ return false;
+ }
+
/// \brief Receives the contents of the predefines buffer.
///
/// \param Buffers Information about the predefines buffers.
@@ -947,6 +957,8 @@ private:
ASTReaderListener &Listener);
static bool ParseHeaderSearchOptions(const RecordData &Record, bool Complain,
ASTReaderListener &Listener);
+ static bool ParsePreprocessorOptions(const RecordData &Record, bool Complain,
+ ASTReaderListener &Listener);
struct RecordLocation {
RecordLocation(ModuleFile *M, uint64_t O)