summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-11-17 21:02:25 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-11-17 21:02:25 +0000
commit531e901deba00544dbec32bf72a73018473d634b (patch)
tree24372c1ba90ac28c89921e73a4257dce716b2f35 /llvm/lib
parentf8d6f7e973c5e2d9b7aaff8f01478abf8158efc0 (diff)
downloadbcm5719-llvm-531e901deba00544dbec32bf72a73018473d634b.tar.gz
bcm5719-llvm-531e901deba00544dbec32bf72a73018473d634b.zip
Make ReturnInst accept a value of type void as the return value. The
ReturnInst constructed is the same as if NULL was passed instead of the void value. llvm-svn: 17923
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 029ee6a0f6b..44167cbae71 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -233,6 +233,15 @@ Function *CallSite::getCalledFunction() const {
// ReturnInst Implementation
//===----------------------------------------------------------------------===//
+void ReturnInst::init(Value* RetVal) {
+ if (RetVal && RetVal->getType() != Type::VoidTy) {
+ assert(!isa<BasicBlock>(RetVal) &&
+ "Cannot return basic block. Probably using the incorrect ctor");
+ Operands.reserve(1);
+ Operands.push_back(Use(RetVal, this));
+ }
+}
+
// Out-of-line ReturnInst method, put here so the C++ compiler can choose to
// emit the vtable for the class in this translation unit.
void ReturnInst::setSuccessor(unsigned idx, BasicBlock *NewSucc) {
OpenPOWER on IntegriCloud