blob: 142e639b3ef7702bb752e83e59e9cc8b58090bba [file] [log] [blame]
Justin Holewinskid8e4ed22011-09-28 14:32:04 +00001//===-- 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
23void 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 Holewinskif51b7e52011-09-30 14:36:36 +000029 OutMI.addOperand(AP.lowerOperand(MO));
Justin Holewinskid8e4ed22011-09-28 14:32:04 +000030 }
31}
32