diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-02 23:18:59 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-02 23:18:59 +0000 |
commit | 75d8a32817556619c7ab8bcaac57e688c18dfe0b (patch) | |
tree | bc96082110a33bc7691c079bb3ece03ad0d14414 /clang/lib/Frontend/PCHWriter.cpp | |
parent | 272980b3f6311b64f630a4d7af65ea67c8d54ad4 (diff) | |
download | bcm5719-llvm-75d8a32817556619c7ab8bcaac57e688c18dfe0b.tar.gz bcm5719-llvm-75d8a32817556619c7ab8bcaac57e688c18dfe0b.zip |
Simplify global method pool implementation in Sema. No functionality change.
llvm-svn: 110078
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 641492ca598..971f5e8fb2c 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -1654,50 +1654,17 @@ void PCHWriter::WriteMethodPool(Sema &SemaRef) { OnDiskChainedHashTableGenerator<PCHMethodPoolTrait> Generator; // Create the on-disk hash table representation. Start by - // iterating through the instance method pool. + // iterating through the method pool. PCHMethodPoolTrait::key_type Key; unsigned NumSelectorsInMethodPool = 0; - for (llvm::DenseMap<Selector, ObjCMethodList>::iterator - Instance = SemaRef.InstanceMethodPool.begin(), - InstanceEnd = SemaRef.InstanceMethodPool.end(); - Instance != InstanceEnd; ++Instance) { - // Check whether there is a factory method with the same - // selector. - llvm::DenseMap<Selector, ObjCMethodList>::iterator Factory - = SemaRef.FactoryMethodPool.find(Instance->first); - - if (Factory == SemaRef.FactoryMethodPool.end()) - Generator.insert(Instance->first, - std::make_pair(Instance->second, - ObjCMethodList())); - else - Generator.insert(Instance->first, - std::make_pair(Instance->second, Factory->second)); - + for (Sema::GlobalMethodPool::iterator I = SemaRef.MethodPool.begin(), + E = SemaRef.MethodPool.end(); + I != E; ++I) { + Generator.insert(I->first, I->second); ++NumSelectorsInMethodPool; Empty = false; } - // Now iterate through the factory method pool, to pick up any - // selectors that weren't already in the instance method pool. - for (llvm::DenseMap<Selector, ObjCMethodList>::iterator - Factory = SemaRef.FactoryMethodPool.begin(), - FactoryEnd = SemaRef.FactoryMethodPool.end(); - Factory != FactoryEnd; ++Factory) { - // Check whether there is an instance method with the same - // selector. If so, there is no work to do here. - llvm::DenseMap<Selector, ObjCMethodList>::iterator Instance - = SemaRef.InstanceMethodPool.find(Factory->first); - - if (Instance == SemaRef.InstanceMethodPool.end()) { - Generator.insert(Factory->first, - std::make_pair(ObjCMethodList(), Factory->second)); - ++NumSelectorsInMethodPool; - } - - Empty = false; - } - if (Empty && SelectorOffsets.empty()) return; |