Fix for PR1801
[llvm-complete.git] / lib / Target / X86 / X86ATTAsmPrinter.h
blob225a71389f79209f5772eb8da4bdb7c9db278cd2
1 //===-- X86ATTAsmPrinter.h - Convert X86 LLVM code to AT&T assembly -------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // AT&T assembly code printer class.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86ATTASMPRINTER_H
15 #define X86ATTASMPRINTER_H
17 #include "X86AsmPrinter.h"
18 #include "llvm/CodeGen/ValueTypes.h"
20 namespace llvm {
22 struct MachineJumpTableInfo;
24 struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public X86SharedAsmPrinter {
25 X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T)
26 : X86SharedAsmPrinter(O, TM, T) { }
28 virtual const char *getPassName() const {
29 return "X86 AT&T-Style Assembly Printer";
32 /// printInstruction - This method is automatically generated by tablegen
33 /// from the instruction set description. This method returns true if the
34 /// machine instruction was sufficiently described to print it, otherwise it
35 /// returns false.
36 bool printInstruction(const MachineInstr *MI);
38 // These methods are used by the tablegen'erated instruction printer.
39 void printOperand(const MachineInstr *MI, unsigned OpNo,
40 const char *Modifier = 0, bool NotRIPRel = false);
41 void printi8mem(const MachineInstr *MI, unsigned OpNo) {
42 printMemReference(MI, OpNo);
44 void printi16mem(const MachineInstr *MI, unsigned OpNo) {
45 printMemReference(MI, OpNo);
47 void printi32mem(const MachineInstr *MI, unsigned OpNo) {
48 printMemReference(MI, OpNo);
50 void printi64mem(const MachineInstr *MI, unsigned OpNo) {
51 printMemReference(MI, OpNo);
53 void printi128mem(const MachineInstr *MI, unsigned OpNo) {
54 printMemReference(MI, OpNo);
56 void printf32mem(const MachineInstr *MI, unsigned OpNo) {
57 printMemReference(MI, OpNo);
59 void printf64mem(const MachineInstr *MI, unsigned OpNo) {
60 printMemReference(MI, OpNo);
62 void printf80mem(const MachineInstr *MI, unsigned OpNo) {
63 printMemReference(MI, OpNo);
65 void printf128mem(const MachineInstr *MI, unsigned OpNo) {
66 printMemReference(MI, OpNo);
68 void printlea64_32mem(const MachineInstr *MI, unsigned OpNo) {
69 printMemReference(MI, OpNo, "subreg64");
72 bool printAsmMRegister(const MachineOperand &MO, const char Mode);
73 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
74 unsigned AsmVariant, const char *ExtraCode);
75 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
76 unsigned AsmVariant, const char *ExtraCode);
78 void printMachineInstruction(const MachineInstr *MI);
79 void printSSECC(const MachineInstr *MI, unsigned Op);
80 void printMemReference(const MachineInstr *MI, unsigned Op,
81 const char *Modifier=NULL);
82 void printPICJumpTableSetLabel(unsigned uid,
83 const MachineBasicBlock *MBB) const;
84 void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
85 const MachineBasicBlock *MBB) const {
86 AsmPrinter::printPICJumpTableSetLabel(uid, uid2, MBB);
88 void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
89 const MachineBasicBlock *MBB,
90 unsigned uid) const;
92 void printPICLabel(const MachineInstr *MI, unsigned Op);
93 bool runOnMachineFunction(MachineFunction &F);
95 /// getSectionForFunction - Return the section that we should emit the
96 /// specified function body into.
97 virtual std::string getSectionForFunction(const Function &F) const;
100 } // end namespace llvm
102 #endif