aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Instructions.h
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
commit859804f529d73120a4414c43cae5fc546453a37f (patch)
tree417e2097169df37ccb5c0ab29f89262b4e4232ca /include/llvm/Instructions.h
parenta1c15bda23819f3a5c3349ca15551a7329293cd6 (diff)
downloadexternal_llvm-859804f529d73120a4414c43cae5fc546453a37f.tar.gz
external_llvm-859804f529d73120a4414c43cae5fc546453a37f.tar.bz2
external_llvm-859804f529d73120a4414c43cae5fc546453a37f.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 714f7d7fb6..b52ebd9aca 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -807,23 +807,20 @@ class ReturnInst : public TerminatorInst {
}
}
- void init(Value *RetVal) {
- if (RetVal) {
- assert(!isa<BasicBlock>(RetVal) &&
- "Cannot return basic block. Probably using the incorrect ctor");
- Operands.reserve(1);
- Operands.push_back(Use(RetVal, this));
- }
- }
+ void init(Value *RetVal);
public:
// ReturnInst constructors:
// ReturnInst() - 'ret void' instruction
+ // ReturnInst( null) - 'ret void' instruction
// ReturnInst(Value* X) - 'ret X' instruction
// ReturnInst( null, Inst *) - 'ret void' instruction, insert before I
// ReturnInst(Value* X, Inst *I) - 'ret X' instruction, insert before I
// ReturnInst( null, BB *B) - 'ret void' instruction, insert @ end of BB
// ReturnInst(Value* X, BB *B) - 'ret X' instruction, insert @ end of BB
+ //
+ // NOTE: If the Value* passed is of type void then the constructor behaves as
+ // if it was passed NULL.
ReturnInst(Value *RetVal = 0, Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Ret, InsertBefore) {
init(RetVal);