aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
committerOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
commitdebcb01b0f0a15f568ca69e8f288fade4bfc7297 (patch)
tree22a274838cf6c55205a8a3f0a80262b09b63b069 /lib/Transforms/Utils/CodeExtractor.cpp
parent37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff)
Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index ab10baa772..d897c2acd1 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -266,8 +266,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
if (AggregateArgs)
paramTy.push_back((*I)->getType());
else
- paramTy.push_back(
- header->getContext().getPointerTypeUnqual((*I)->getType()));
+ paramTy.push_back(PointerType::getUnqual((*I)->getType()));
}
DOUT << "Function type: " << *RetTy << " f(";
@@ -278,12 +277,12 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
if (AggregateArgs && (inputs.size() + outputs.size() > 0)) {
PointerType *StructPtr =
- Context.getPointerTypeUnqual(Context.getStructType(paramTy));
+ PointerType::getUnqual(StructType::get(paramTy));
paramTy.clear();
paramTy.push_back(StructPtr);
}
const FunctionType *funcType =
- Context.getFunctionType(RetTy, paramTy, false);
+ FunctionType::get(RetTy, paramTy, false);
// Create the new function
Function *newFunction = Function::Create(funcType,
@@ -387,7 +386,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
ArgTypes.push_back((*v)->getType());
// Allocate a struct at the beginning of this function
- Type *StructArgTy = Context.getStructType(ArgTypes);
+ Type *StructArgTy = StructType::get(ArgTypes);
Struct =
new AllocaInst(StructArgTy, 0, "structArg",
codeReplacer->getParent()->begin()->begin());