aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-25 20:36:15 +0000
committerDan Gohman <gohman@apple.com>2008-07-25 20:36:15 +0000
commita5bf78bc28e7cbd30a284e546cd4b4bbecbc113a (patch)
tree8a911f1afd87b6da9fbbfbd349b600ad36f04169 /include
parentcadb9b18d0c31620db3f83c40152f7aa98ca0232 (diff)
downloadexternal_llvm-a5bf78bc28e7cbd30a284e546cd4b4bbecbc113a.zip
external_llvm-a5bf78bc28e7cbd30a284e546cd4b4bbecbc113a.tar.gz
external_llvm-a5bf78bc28e7cbd30a284e546cd4b4bbecbc113a.tar.bz2
Rename the version of CreateRet that's a convenience method for creating
multiple-valued return values, so that the name CreateRet is just for creating plain ret statements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/IRBuilder.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 9cc1d90..c316f57 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -101,12 +101,15 @@ public:
return Insert(ReturnInst::Create(V));
}
- ReturnInst *CreateRet(Value * const* retVals, unsigned N) {
+ /// CreateAggregateRet - Create a sequence of N insertvalue instructions,
+ /// with one Value from the retVals array each, that build a aggregate
+ /// return value one value at a time, and a ret instruction to return
+ /// the resulting aggregate value. This is a convenience function for
+ /// code that uses aggregate return values as a vehicle for having
+ /// multiple return values.
+ ///
+ ReturnInst *CreateAggregateRet(Value * const* retVals, unsigned N) {
const Type *RetType = BB->getParent()->getReturnType();
- if (N == 0 && RetType == Type::VoidTy)
- return CreateRetVoid();
- if (N == 1 && retVals[0]->getType() == RetType)
- return Insert(ReturnInst::Create(retVals[0]));
Value *V = UndefValue::get(RetType);
for (unsigned i = 0; i != N; ++i)
V = CreateInsertValue(V, retVals[i], i, "mrv");