diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-01-15 15:37:28 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-01-15 15:37:28 +0000 | 
| commit | 829000e035f46f2a227a5466e4e427a2f3cc00a9 (patch) | |
| tree | be5a687969f682edded4aa6f13594ffd9aa9030e /lib/CodeGen/MachineInstr.cpp | |
| parent | 1e7804dbd25b8dbf534c850355d70ad215206f4b (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
| -rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index a761c2daa96b..cf3e3e16014a 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -28,11 +28,13 @@  #include "llvm/Target/TargetRegisterInfo.h"  #include "llvm/Analysis/AliasAnalysis.h"  #include "llvm/Analysis/DebugInfo.h" +#include "llvm/Support/Debug.h"  #include "llvm/Support/ErrorHandling.h"  #include "llvm/Support/LeakDetector.h"  #include "llvm/Support/MathExtras.h"  #include "llvm/Support/raw_ostream.h"  #include "llvm/ADT/FoldingSet.h" +#include "llvm/Metadata.h"  using namespace llvm;  //===----------------------------------------------------------------------===// @@ -277,10 +279,15 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {      OS << '>';      break;    case MachineOperand::MO_BlockAddress: -    OS << "<"; +    OS << '<';      WriteAsOperand(OS, getBlockAddress(), /*PrintType=*/false);      OS << '>';      break; +  case MachineOperand::MO_Metadata: +    OS << '<'; +    WriteAsOperand(OS, getMetadata(), /*PrintType=*/false); +    OS << '>'; +    break;    default:      llvm_unreachable("Unrecognized operand type");    } @@ -1094,7 +1101,7 @@ unsigned MachineInstr::isConstantValuePHI() const {  }  void MachineInstr::dump() const { -  errs() << "  " << *this; +  dbgs() << "  " << *this;  }  void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const { @@ -1313,3 +1320,12 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,                                         true  /*IsDead*/));    return true;  } + +void MachineInstr::addRegisterDefined(unsigned IncomingReg, +                                      const TargetRegisterInfo *RegInfo) { +  MachineOperand *MO = findRegisterDefOperand(IncomingReg, false, RegInfo); +  if (!MO || MO->getSubReg()) +    addOperand(MachineOperand::CreateReg(IncomingReg, +                                         true  /*IsDef*/, +                                         true  /*IsImp*/)); +}  | 
