]> granicus.if.org Git - clang/commit
Rework the (de-)serialization of macros, as stored in
authorDouglas Gregor <dgregor@apple.com>
Tue, 9 Oct 2012 23:05:51 +0000 (23:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 9 Oct 2012 23:05:51 +0000 (23:05 +0000)
commita8235d6c4093cd38dcf742909651f867de62e55b
treec922c78bc940cc44f4aaa96c5eb3dc77b3bddb82
parent8b2bfdda35de8239df0ff4a588214d5876a38d28
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
26 files changed:
include/clang/AST/ASTConsumer.h
include/clang/AST/ASTMutationListener.h
include/clang/Lex/PPMutationListener.h [new file with mode: 0644]
include/clang/Lex/Preprocessor.h
include/clang/Serialization/ASTBitCodes.h
include/clang/Serialization/ASTDeserializationListener.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
include/clang/Serialization/Module.h
lib/Frontend/ChainedIncludesSource.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/FrontendAction.cpp
lib/Lex/PPDirectives.cpp
lib/Lex/Pragma.cpp
lib/Lex/Preprocessor.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/GeneratePCH.cpp
lib/Serialization/Module.cpp
test/Modules/Inputs/macros_left.h [new file with mode: 0644]
test/Modules/Inputs/macros_other.h [new file with mode: 0644]
test/Modules/Inputs/macros_right.h [new file with mode: 0644]
test/Modules/Inputs/macros_top.h [new file with mode: 0644]
test/PCH/Inputs/chain-macro-override1.h
test/PCH/Inputs/chain-macro-override2.h
test/PCH/chain-macro-override.c