aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-08-02 23:18:59 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-08-02 23:18:59 +0000
commitdb9d2145f1d85f64dba2c9b92416621ce01090a6 (patch)
tree39357e18129698727f20fbaff48fb840adf8f15d /lib/Frontend/PCHWriter.cpp
parentf8dcf1a1d3c4f28fc96a45d7159e1a9c95484632 (diff)
Simplify global method pool implementation in Sema. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp43
1 files changed, 5 insertions, 38 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 641492ca59..971f5e8fb2 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/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;