Convert to SymbolTable's new iteration interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-05-25 08:53:40 +00:00
parent af90b0d8b8
commit 9231ac8b6f
9 changed files with 178 additions and 132 deletions
+7 -5
View File
@@ -33,11 +33,11 @@ Module *llvm::CloneModule(const Module *M) {
// Copy all of the type symbol table entries over...
const SymbolTable &SymTab = M->getSymbolTable();
SymbolTable::const_iterator TypeI = SymTab.find(Type::TypeTy);
if (TypeI != SymTab.end())
for (SymbolTable::VarMap::const_iterator I = TypeI->second.begin(),
E = TypeI->second.end(); I != E; ++I)
New->addTypeName(I->first, cast<Type>(I->second));
SymbolTable::type_const_iterator TypeI = SymTab.type_begin();
SymbolTable::type_const_iterator TypeE = SymTab.type_end();
for ( ; TypeI != TypeE; ++TypeI ) {
New->addTypeName(TypeI->first, TypeI->second);
}
// Create the value map that maps things from the old module over to the new
// module.
@@ -89,3 +89,5 @@ Module *llvm::CloneModule(const Module *M) {
return New;
}
// vim: sw=2