1 //===-- PTXMCInstLower.cpp - Convert PTX MachineInstr to an MCInst --------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains code to lower PTX MachineInstrs to their corresponding
13 //===----------------------------------------------------------------------===//
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"
23 void llvm::LowerPTXMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
25 OutMI.setOpcode(MI->getOpcode());
26 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
27 const MachineOperand &MO = MI->getOperand(i);
29 OutMI.addOperand(AP.lowerOperand(MO));