[llvm-commits] [llvm] r84527 - in /llvm/trunk/lib/Target/ARM/AsmPrinter: ARMInstPrinter.cpp ARMInstPrinter.h CMakeLists.txt
Chris Lattner
sabre at nondot.org
Mon Oct 19 12:56:37 PDT 2009
Author: lattner
Date: Mon Oct 19 14:56:26 2009
New Revision: 84527
URL: http://llvm.org/viewvc/llvm-project?rev=84527&view=rev
Log:
stub out a minimal ARMInstPrinter.
Added:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/CMakeLists.txt
Added: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp?rev=84527&view=auto
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp (added)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp Mon Oct 19 14:56:26 2009
@@ -0,0 +1,33 @@
+//===-- ARMInstPrinter.cpp - Convert ARM MCInst to assembly syntax --------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This class prints an ARM MCInst to a .s file.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "asm-printer"
+#include "ARMInstPrinter.h"
+#include "llvm/MC/MCInst.h"
+//#include "llvm/MC/MCAsmInfo.h"
+//#include "llvm/MC/MCExpr.h"
+//#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
+#include "ARMGenInstrNames.inc"
+using namespace llvm;
+
+// Include the auto-generated portion of the assembly writer.
+#define MachineInstr MCInst
+#define ARMAsmPrinter ARMInstPrinter // FIXME: REMOVE.
+#define NO_ASM_WRITER_BOILERPLATE
+#include "ARMGenAsmWriter.inc"
+#undef MachineInstr
+#undef ARMAsmPrinter
+
+void ARMInstPrinter::printInst(const MCInst *MI) { printInstruction(MI); }
+
Added: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h?rev=84527&view=auto
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h (added)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h Mon Oct 19 14:56:26 2009
@@ -0,0 +1,86 @@
+//===-- ARMInstPrinter.h - Convert ARM MCInst to assembly syntax ----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This class prints an ARM MCInst to a .s file.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ARMINSTPRINTER_H
+#define ARMINSTPRINTER_H
+
+#include "llvm/MC/MCInstPrinter.h"
+
+namespace llvm {
+ class MCOperand;
+
+class ARMInstPrinter : public MCInstPrinter {
+public:
+ ARMInstPrinter(raw_ostream &O, const MCAsmInfo &MAI) : MCInstPrinter(O, MAI){}
+
+ virtual void printInst(const MCInst *MI);
+
+ // Autogenerated by tblgen.
+ void printInstruction(const MCInst *MI);
+ static const char *getRegisterName(unsigned RegNo);
+
+
+ void printOperand(const MCInst *MI, unsigned OpNo,
+ const char *Modifier = 0) {}
+
+ void printSOImmOperand(const MCInst *MI, unsigned OpNum) {}
+ void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum) {}
+ void printSORegOperand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrMode2Operand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrMode3Operand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrMode4Operand(const MCInst *MI, unsigned OpNum,
+ const char *Modifier = 0) {}
+ void printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
+ const char *Modifier = 0) {}
+ void printAddrMode6Operand(const MCInst *MI, unsigned OpNum) {}
+ void printAddrModePCOperand(const MCInst *MI, unsigned OpNum,
+ const char *Modifier = 0) {}
+ void printBitfieldInvMaskImmOperand (const MCInst *MI, unsigned OpNum) {}
+
+ void printThumbITMask(const MCInst *MI, unsigned OpNum) {}
+ void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum) {}
+ void printThumbAddrModeRI5Operand(const MCInst *MI, unsigned OpNum,
+ unsigned Scale) {}
+ void printThumbAddrModeS1Operand(const MCInst *MI, unsigned OpNum) {}
+ void printThumbAddrModeS2Operand(const MCInst *MI, unsigned OpNum) {}
+ void printThumbAddrModeS4Operand(const MCInst *MI, unsigned OpNum) {}
+ void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum) {}
+
+ void printT2SOOperand(const MCInst *MI, unsigned OpNum) {}
+ void printT2AddrModeImm12Operand(const MCInst *MI, unsigned OpNum) {}
+ void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum) {}
+ void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum) {}
+ void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum) {}
+ void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum) {}
+
+ void printPredicateOperand(const MCInst *MI, unsigned OpNum) {}
+ void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
+ void printPCLabel(const MCInst *MI, unsigned OpNum) {}
+ void printRegisterList(const MCInst *MI, unsigned OpNum) {}
+ void printCPInstOperand(const MCInst *MI, unsigned OpNum,
+ const char *Modifier) {}
+ void printJTBlockOperand(const MCInst *MI, unsigned OpNum) {}
+ void printJT2BlockOperand(const MCInst *MI, unsigned OpNum) {}
+ void printTBAddrMode(const MCInst *MI, unsigned OpNum) {}
+ void printNoHashImmediate(const MCInst *MI, unsigned OpNum) {}
+
+
+ // FIXME:
+ void PrintSpecial(const MCInst *MI, const char *Kind) {}
+};
+
+}
+
+#endif
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/CMakeLists.txt?rev=84527&r1=84526&r2=84527&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/CMakeLists.txt Mon Oct 19 14:56:26 2009
@@ -1,6 +1,7 @@
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. )
add_llvm_library(LLVMARMAsmPrinter
+ ARMInstPrinter.cpp
ARMAsmPrinter.cpp
)
-add_dependencies(LLVMARMAsmPrinter ARMCodeGenTable_gen)
\ No newline at end of file
+add_dependencies(LLVMARMAsmPrinter ARMCodeGenTable_gen)
More information about the llvm-commits
mailing list