aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Serialization/Module.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-09 23:05:51 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-09 23:05:51 +0000
commita8235d6c4093cd38dcf742909651f867de62e55b (patch)
treec922c78bc940cc44f4aaa96c5eb3dc77b3bddb82 /include/clang/Serialization/Module.h
parent8b2bfdda35de8239df0ff4a588214d5876a38d28 (diff)
Rework the (de-)serialization of macros, as stored in
MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization/Module.h')
-rw-r--r--include/clang/Serialization/Module.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h
index 87a0e40e9e..ecf0ae1349 100644
--- a/include/clang/Serialization/Module.h
+++ b/include/clang/Serialization/Module.h
@@ -173,6 +173,22 @@ public:
/// all of the macro definitions.
llvm::BitstreamCursor MacroCursor;
+ /// \brief The number of macros in this AST file.
+ unsigned LocalNumMacros;
+
+ /// \brief Offsets of macros in the preprocessor block.
+ ///
+ /// This array is indexed by the macro ID (-1), and provides
+ /// the offset into the preprocessor block where macro definitions are
+ /// stored.
+ const uint32_t *MacroOffsets;
+
+ /// \brief Base macro ID for macros local to this module.
+ serialization::MacroID BaseMacroID;
+
+ /// \brief Remapping table for macro IDs in this module.
+ ContinuousRangeMap<uint32_t, int, 2> MacroRemap;
+
/// \brief The offset of the start of the set of defined macros.
uint64_t MacroStartOffset;