aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp8
-rw-r--r--lib/Transforms/Utils/CloneModule.cpp8
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp8
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp6
4 files changed, 15 insertions, 15 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
diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp
index d98848aa7c..66e005e82c 100644
--- a/lib/Transforms/Utils/CloneModule.cpp
+++ b/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++;
}
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index 5a04001005..cf9cafb04a 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -295,7 +295,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
newFunction->getBasicBlockList().push_back(newRootNode);
// Create an iterator to name all of the arguments we inserted.
- Function::aiterator AI = newFunction->abegin();
+ Function::arg_iterator AI = newFunction->arg_begin();
// Rewrite all users of the inputs in the extracted region to use the
// arguments (or appropriate addressing into struct) instead.
@@ -322,7 +322,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
// Set names for input and output arguments.
if (!AggregateArgs) {
- AI = newFunction->abegin();
+ AI = newFunction->arg_begin();
for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI)
AI->setName(inputs[i]->getName());
for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI)
@@ -406,7 +406,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
NumExitBlocks > 1 ? "targetBlock" : "");
codeReplacer->getInstList().push_back(call);
- Function::aiterator OutputArgBegin = newFunction->abegin();
+ Function::arg_iterator OutputArgBegin = newFunction->arg_begin();
unsigned FirstOut = inputs.size();
if (!AggregateArgs)
std::advance(OutputArgBegin, inputs.size());
@@ -483,7 +483,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
OldTarget);
// Restore values just before we exit
- Function::aiterator OAI = OutputArgBegin;
+ Function::arg_iterator OAI = OutputArgBegin;
for (unsigned out = 0, e = outputs.size(); out != e; ++out) {
// For an invoke, the normal destination is the only one that is
// dominated by the result of the invocation
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 1384022be7..6bfdda230e 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -60,13 +60,13 @@ bool llvm::InlineFunction(CallSite CS) {
{ // Scope to destroy ValueMap after cloning.
// Calculate the vector of arguments to pass into the function cloner...
std::map<const Value*, Value*> ValueMap;
- assert(std::distance(CalledFunc->abegin(), CalledFunc->aend()) ==
+ assert(std::distance(CalledFunc->arg_begin(), CalledFunc->arg_end()) ==
std::distance(CS.arg_begin(), CS.arg_end()) &&
"No varargs calls can be inlined!");
CallSite::arg_iterator AI = CS.arg_begin();
- for (Function::const_aiterator I = CalledFunc->abegin(),
- E = CalledFunc->aend(); I != E; ++I, ++AI)
+ for (Function::const_arg_iterator I = CalledFunc->arg_begin(),
+ E = CalledFunc->arg_end(); I != E; ++I, ++AI)
ValueMap[I] = *AI;
// Clone the entire body of the callee into the caller.