diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-13 00:28:03 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-13 00:28:03 +0000 |
| commit | e7c1fe6ab7c1d9d26abde49dcf52b8ccc53e914c (patch) | |
| tree | 6a1fd774a5d288c39333ff6c209e3c3e5df12dcb /clang/lib/Frontend/PCHReader.cpp | |
| parent | f7f020bb2afe2943f2f351c5d5e91f5587aa7661 (diff) | |
| download | bcm5719-llvm-e7c1fe6ab7c1d9d26abde49dcf52b8ccc53e914c.tar.gz bcm5719-llvm-e7c1fe6ab7c1d9d26abde49dcf52b8ccc53e914c.zip | |
Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.
llvm-svn: 110989
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 16afabbb7e4..e55605b2743 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -1774,6 +1774,17 @@ PCHReader::ReadPCHBlock(PerFileData &F) { F.NumPreallocatedPreprocessingEntities = Record[0]; F.LocalNumMacroDefinitions = Record[1]; break; + + case pch::DECL_REPLACEMENTS: { + if (Record.size() % 2 != 0) { + Error("invalid DECL_REPLACEMENTS block in PCH file"); + return Failure; + } + for (unsigned I = 0, N = Record.size(); I != N; I += 2) + ReplacedDecls[static_cast<pch::DeclID>(Record[I])] = + std::make_pair(&F, Record[I+1]); + break; + } } First = false; } |

