summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreMCInstLower.h
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2012-12-16 16:20:48 +0000
committerRichard Osborne <richard@xmos.com>2012-12-16 16:20:48 +0000
commit9578d793c9450b315721d5cb15001c2e69bff3d0 (patch)
treedfaa5bad0840a3087065868ab8c044c75fea8440 /lib/Target/XCore/XCoreMCInstLower.h
parent6438214d21b34ae98502428c8632fe8f36739298 (diff)
downloadllvm-9578d793c9450b315721d5cb15001c2e69bff3d0.tar.gz
llvm-9578d793c9450b315721d5cb15001c2e69bff3d0.tar.bz2
llvm-9578d793c9450b315721d5cb15001c2e69bff3d0.tar.xz
Change XCoreAsmPrinter to lower MachineInstrs to MCInsts before emission.
This change adds XCoreMCInstLower to do the lowering to MCInst and XCoreInstPrinter to print the MCInsts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreMCInstLower.h')
-rw-r--r--lib/Target/XCore/XCoreMCInstLower.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Target/XCore/XCoreMCInstLower.h b/lib/Target/XCore/XCoreMCInstLower.h
new file mode 100644
index 0000000000..10bf5d863e
--- /dev/null
+++ b/lib/Target/XCore/XCoreMCInstLower.h
@@ -0,0 +1,44 @@
+//===-- XCoreMCInstLower.h - Lower MachineInstr to MCInst ------*- C++ -*--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef XCOREMCINSTLOWER_H
+#define XCOREMCINSTLOWER_H
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/CodeGen/MachineOperand.h"
+#include "llvm/Support/Compiler.h"
+
+namespace llvm {
+ class MCContext;
+ class MCInst;
+ class MCOperand;
+ class MachineInstr;
+ class MachineFunction;
+ class Mangler;
+ class AsmPrinter;
+
+/// XCoreMCInstLower - This class is used to lower an MachineInstr into an
+// MCInst.
+class LLVM_LIBRARY_VISIBILITY XCoreMCInstLower {
+ typedef MachineOperand::MachineOperandType MachineOperandType;
+ MCContext *Ctx;
+ Mangler *Mang;
+ AsmPrinter &Printer;
+public:
+ XCoreMCInstLower(class AsmPrinter &asmprinter);
+ void Initialize(Mangler *mang, MCContext *C);
+ void Lower(const MachineInstr *MI, MCInst &OutMI) const;
+ MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
+
+private:
+ MCOperand LowerSymbolOperand(const MachineOperand &MO,
+ MachineOperandType MOTy, unsigned Offset) const;
+};
+}
+
+#endif