diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-04 17:20:04 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-04 17:20:04 +0000 |
| commit | 834bb971f61c0d65ad561dcfd1b230c0bc3173b0 (patch) | |
| tree | 9dfb8c65bbe0e2e738f2e7ceb6501d33268cc34d /clang/lib/Frontend/PCHReader.cpp | |
| parent | d8a5dba9c2c09c335d8b6b6a2675da6477f329b3 (diff) | |
| download | bcm5719-llvm-834bb971f61c0d65ad561dcfd1b230c0bc3173b0.tar.gz bcm5719-llvm-834bb971f61c0d65ad561dcfd1b230c0bc3173b0.zip | |
Store the IDs of selectors in the PCH file explicitly.
llvm-svn: 110219
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 7d3a25f367a..ac817ac050c 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -471,7 +471,10 @@ class PCHMethodPoolLookupTrait { PCHReader &Reader; public: - typedef std::pair<ObjCMethodList, ObjCMethodList> data_type; + struct data_type { + pch::SelectorID ID; + ObjCMethodList Instance, Factory; + }; typedef Selector external_key_type; typedef external_key_type internal_key_type; @@ -527,20 +530,22 @@ public: data_type ReadData(Selector, const unsigned char* d, unsigned DataLen) { using namespace clang::io; - unsigned NumInstanceMethods = ReadUnalignedLE16(d); - unsigned NumFactoryMethods = ReadUnalignedLE16(d); data_type Result; + Result.ID = ReadUnalignedLE32(d); + unsigned NumInstanceMethods = ReadUnalignedLE16(d); + unsigned NumFactoryMethods = ReadUnalignedLE16(d); + // Load instance methods ObjCMethodList *Prev = 0; for (unsigned I = 0; I != NumInstanceMethods; ++I) { ObjCMethodDecl *Method = cast<ObjCMethodDecl>(Reader.GetDecl(ReadUnalignedLE32(d))); - if (!Result.first.Method) { + if (!Result.Instance.Method) { // This is the first method, which is the easy case. - Result.first.Method = Method; - Prev = &Result.first; + Result.Instance.Method = Method; + Prev = &Result.Instance; continue; } @@ -555,10 +560,10 @@ public: for (unsigned I = 0; I != NumFactoryMethods; ++I) { ObjCMethodDecl *Method = cast<ObjCMethodDecl>(Reader.GetDecl(ReadUnalignedLE32(d))); - if (!Result.second.Method) { + if (!Result.Factory.Method) { // This is the first method, which is the easy case. - Result.second.Method = Method; - Prev = &Result.second; + Result.Factory.Method = Method; + Prev = &Result.Factory; continue; } @@ -3215,11 +3220,14 @@ PCHReader::ReadMethodPool(Selector Sel) { PCHMethodPoolLookupTable::iterator Pos = PoolTable->find(Sel); if (Pos == PoolTable->end()) { ++NumMethodPoolMisses; - return std::pair<ObjCMethodList, ObjCMethodList>();; + return std::pair<ObjCMethodList, ObjCMethodList>(); } ++NumMethodPoolSelectorsRead; - return *Pos; + PCHMethodPoolLookupTrait::data_type Data = *Pos; + if (DeserializationListener) + DeserializationListener->SelectorRead(Data.ID, Sel); + return std::make_pair(Data.Instance, Data.Factory); } void PCHReader::SetIdentifierInfo(unsigned ID, IdentifierInfo *II) { |

