Moved UnaryOperator::create to InstrTypes.cpp until there is an iUnaryOps.cpp
[oota-llvm.git] / lib / VMCore / iReturn.cpp
1 //===-- iReturn.cpp - Implement the Return instruction -----------*- C++ -*--=//
2 //
3 // This file implements the Return instruction...
4 //
5 //===----------------------------------------------------------------------===//
6
7 #include "llvm/iTerminators.h"
8
9 ReturnInst::ReturnInst(Value *V)
10   : TerminatorInst(Instruction::Ret), Val(V, this) {
11 }
12
13 ReturnInst::ReturnInst(const ReturnInst &RI)
14   : TerminatorInst(Instruction::Ret), Val(RI.Val, this) {
15 }
16
17 void ReturnInst::dropAllReferences() {
18   Val = 0;
19 }
20
21 bool ReturnInst::setOperand(unsigned i, Value *V) { 
22   if (i) return false; 
23   Val = V;
24   return true;
25 }