summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.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
commite4d5c441e04bdc00ccf1804744af670655123b07 (patch)
treebe1bff1314e39651d7120d2d887b79b10dc2f24d /lib/Transforms/Utils/CloneFunction.cpp
parent89cc2656ba070434dceeabe95cba0a95b988325b (diff)
downloadllvm-e4d5c441e04bdc00ccf1804744af670655123b07.tar.gz
llvm-e4d5c441e04bdc00ccf1804744af670655123b07.tar.bz2
llvm-e4d5c441e04bdc00ccf1804744af670655123b07.tar.xz
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
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 9bd8bf135f..6440851b9d 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -49,7 +49,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
assert(NameSuffix && "NameSuffix cannot be null!");
#ifndef NDEBUG
- for (Function::const_aiterator I = OldFunc->abegin(), E = OldFunc->aend();
+ for (Function::const_arg_iterator I = OldFunc->arg_begin(), E = OldFunc->arg_end();
I != E; ++I)
assert(ValueMap.count(I) && "No mapping from source argument specified!");
#endif
@@ -95,7 +95,7 @@ Function *llvm::CloneFunction(const Function *F,
// The user might be deleting arguments to the function by specifying them in
// the ValueMap. If so, we need to not add the arguments to the arg ty vector
//
- for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+ for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
if (ValueMap.count(I) == 0) // Haven't mapped the argument to anything yet?
ArgTypes.push_back(I->getType());
@@ -107,8 +107,8 @@ Function *llvm::CloneFunction(const Function *F,
Function *NewF = new Function(FTy, F->getLinkage(), F->getName());
// Loop over the arguments, copying the names of the mapped arguments over...
- Function::aiterator DestI = NewF->abegin();
- for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+ Function::arg_iterator DestI = NewF->arg_begin();
+ for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
if (ValueMap.count(I) == 0) { // Is this argument preserved?
DestI->setName(I->getName()); // Copy the name over...
ValueMap[I] = DestI++; // Add mapping to ValueMap