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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-03-15 04:54:21 +00:00
parent 89cc2656ba
commit e4d5c441e0
65 changed files with 185 additions and 185 deletions

View File

@@ -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++;
}