aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-15 04:54:21 +0000
committerChris Lattner <sabre@nondot.org>2005-03-15 04:54:21 +0000
commit531f9e92d4d06d5cb1f250754c68e7d3b420df50 (patch)
tree741411707d21f866eb629b2449413d85b8b48667 /llvm/lib/Transforms/Utils/CloneModule.cpp
parent5ce25cdc6d8d274d9106280d861adaf4743e5f3d (diff)
downloadllvm-531f9e92d4d06d5cb1f250754c68e7d3b420df50.zip
llvm-531f9e92d4d06d5cb1f250754c68e7d3b420df50.tar.gz
llvm-531f9e92d4d06d5cb1f250754c68e7d3b420df50.tar.bz2
This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneModule.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index d98848a..66e005e 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -47,7 +47,7 @@ Module *llvm::CloneModule(const Module *M) {
// new module. Here we add them to the ValueMap and to the new Module. We
// don't worry about attributes or initializers, they will come later.
//
- for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+ for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
ValueMap[I] = new GlobalVariable(I->getType()->getElementType(), false,
GlobalValue::ExternalLinkage, 0,
I->getName(), New);
@@ -61,7 +61,7 @@ Module *llvm::CloneModule(const Module *M) {
// have been created, loop through and copy the global variable referrers
// over... We also set the attributes on the global now.
//
- for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
+ for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) {
GlobalVariable *GV = cast<GlobalVariable>(ValueMap[I]);
if (I->hasInitializer())
GV->setInitializer(cast<Constant>(MapValue(I->getInitializer(),
@@ -74,8 +74,8 @@ Module *llvm::CloneModule(const Module *M) {
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
Function *F = cast<Function>(ValueMap[I]);
if (!I->isExternal()) {
- Function::aiterator DestI = F->abegin();
- for (Function::const_aiterator J = I->abegin(); J != I->aend(); ++J) {
+ Function::arg_iterator DestI = F->arg_begin();
+ for (Function::const_arg_iterator J = I->arg_begin(); J != I->arg_end(); ++J) {
DestI->setName(J->getName());
ValueMap[J] = DestI++;
}