Justin Holewinski | d8e4ed2 | 2011-09-28 14:32:04 +0000 | [diff] [blame] | 1 | //===-- PTXMCInstLower.cpp - Convert PTX MachineInstr to an MCInst --------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains code to lower PTX MachineInstrs to their corresponding |
| 11 | // MCInst records. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "PTX.h" |
| 16 | #include "PTXAsmPrinter.h" |
| 17 | #include "llvm/Constants.h" |
| 18 | #include "llvm/CodeGen/MachineBasicBlock.h" |
| 19 | #include "llvm/MC/MCExpr.h" |
| 20 | #include "llvm/MC/MCInst.h" |
| 21 | #include "llvm/Target/Mangler.h" |
| 22 | |
| 23 | void llvm::LowerPTXMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, |
| 24 | PTXAsmPrinter &AP) { |
| 25 | OutMI.setOpcode(MI->getOpcode()); |
| 26 | for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { |
| 27 | const MachineOperand &MO = MI->getOperand(i); |
| 28 | MCOperand MCOp; |
Justin Holewinski | f51b7e5 | 2011-09-30 14:36:36 +0000 | [diff] [blame^] | 29 | OutMI.addOperand(AP.lowerOperand(MO)); |
Justin Holewinski | d8e4ed2 | 2011-09-28 14:32:04 +0000 | [diff] [blame] | 30 | } |
| 31 | } |
| 32 | |