diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
commit | 55f1c09e31cfc6744fb682e17a2a1a00d914694c (patch) | |
tree | e753e20c7186dc8138bef58089274bb5162a7cef /llvm/lib/Transforms/IPO/StructRetPromotion.cpp | |
parent | 41a750271b72216801366693bd0f41672892c487 (diff) | |
download | bcm5719-llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.tar.gz bcm5719-llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.zip |
Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
Diffstat (limited to 'llvm/lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/StructRetPromotion.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp index a2413597a3e..743dbf7fa26 100644 --- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp @@ -94,7 +94,8 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { DEBUG(errs() << "SretPromotion: Looking at sret function " << F->getName() << "\n"); - assert (F->getReturnType() == Type::VoidTy && "Invalid function return type"); + assert (F->getReturnType() == Type::getVoidTy(F->getContext()) && + "Invalid function return type"); Function::arg_iterator AI = F->arg_begin(); const llvm::PointerType *FArgType = dyn_cast<PointerType>(AI->getType()); assert (FArgType && "Invalid sret parameter type"); @@ -124,7 +125,7 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { ++BI; if (isa<ReturnInst>(I)) { Value *NV = new LoadInst(TheAlloca, "mrv.ld", I); - ReturnInst *NR = ReturnInst::Create(NV, I); + ReturnInst *NR = ReturnInst::Create(F->getContext(), NV, I); I->replaceAllUsesWith(NR); I->eraseFromParent(); } @@ -347,7 +348,7 @@ bool SRETPromotion::nestedStructType(const StructType *STy) { unsigned Num = STy->getNumElements(); for (unsigned i = 0; i < Num; i++) { const Type *Ty = STy->getElementType(i); - if (!Ty->isSingleValueType() && Ty != Type::VoidTy) + if (!Ty->isSingleValueType() && Ty != Type::getVoidTy(STy->getContext())) return true; } return false; |