summaryrefslogtreecommitdiff
path: root/lib/VMCore/iReturn.cpp
blob: 7fa04fb42c68e2c0687ff7fb5147b099d5118796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===-- iReturn.cpp - Implement the Return instruction -----------*- C++ -*--=//
//
// This file implements the Return instruction...
//
//===----------------------------------------------------------------------===//

#include "llvm/iTerminators.h"

ReturnInst::ReturnInst(Value *V)
  : TerminatorInst(Instruction::Ret), Val(V, this) {
}

ReturnInst::ReturnInst(const ReturnInst &RI)
  : TerminatorInst(Instruction::Ret), Val(RI.Val, this) {
}

void ReturnInst::dropAllReferences() {
  Val = 0;
}

bool ReturnInst::setOperand(unsigned i, Value *V) { 
  if (i) return false; 
  Val = V;
  return true;
}