summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CloneModule.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-06 07:24:44 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-06 07:24:44 +0000
commit32af9e8cc54eb85340c1ff1b46e0d5a3afc3db4a (patch)
tree6427b085ec992c547b266323673e0c83b4c6770a /llvm/lib/Transforms/Utils/CloneModule.cpp
parentebbbbf62736651d6fc5640cfa5574da28568efc5 (diff)
downloadbcm5719-llvm-32af9e8cc54eb85340c1ff1b46e0d5a3afc3db4a.tar.gz
bcm5719-llvm-32af9e8cc54eb85340c1ff1b46e0d5a3afc3db4a.zip
For PR411:
Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. llvm-svn: 32956
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneModule.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index 229debf1980..696d9d1b051 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -16,6 +16,7 @@
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/SymbolTable.h"
+#include "llvm/TypeSymbolTable.h"
#include "llvm/Constant.h"
#include "ValueMapper.h"
using namespace llvm;
@@ -42,11 +43,10 @@ Module *llvm::CloneModule(const Module *M, std::map<const Value*, Value*> &Value
New->setModuleInlineAsm(M->getModuleInlineAsm());
// Copy all of the type symbol table entries over.
- const SymbolTable &SymTab = M->getSymbolTable();
- 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);
+ const TypeSymbolTable &TST = M->getTypeSymbolTable();
+ for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
+ TI != TE; ++TI)
+ New->addTypeName(TI->first, TI->second);
// Copy all of the dependent libraries over.
for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I)
OpenPOWER on IntegriCloud