move mangler quote handling from asm printers to TargetAsmInfo.
[oota-llvm.git] / lib / Target / X86 / AsmPrinter / X86IntelAsmPrinter.h
index c9ca072baf5e6fe919a3b32dc6814c7f6ac2bbad..9520d982f6925a2de5fb16a06dab205999cc7768 100644 (file)
 #ifndef X86INTELASMPRINTER_H
 #define X86INTELASMPRINTER_H
 
-#include "X86.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86TargetMachine.h"
+#include "../X86.h"
+#include "../X86MachineFunctionInfo.h"
+#include "../X86TargetMachine.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
 
 struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
-  X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM,
-                     const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T) {
-  }
+  explicit X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
+                              const TargetAsmInfo *T, CodeGenOpt::Level OL,
+                              bool V)
+    : AsmPrinter(O, TM, T, OL, V) {}
 
   virtual const char *getPassName() const {
     return "X86 Intel-Style Assembly Printer";
@@ -43,7 +44,7 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
   void printOperand(const MachineInstr *MI, unsigned OpNo,
                     const char *Modifier = 0) {
     const MachineOperand &MO = MI->getOperand(OpNo);
-    if (MO.isRegister()) {
+    if (MO.isReg()) {
       assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) &&
              "Not physreg??");
       O << TM.getRegisterInfo()->get(MO.getReg()).Name;  // Capitalized names
@@ -88,9 +89,17 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
     O << "XMMWORD PTR ";
     printMemReference(MI, OpNo);
   }
+  void printlea32mem(const MachineInstr *MI, unsigned OpNo) {
+    O << "DWORD PTR ";
+    printLeaMemReference(MI, OpNo);
+  }
+  void printlea64mem(const MachineInstr *MI, unsigned OpNo) {
+    O << "QWORD PTR ";
+    printLeaMemReference(MI, OpNo);
+  }
   void printlea64_32mem(const MachineInstr *MI, unsigned OpNo) {
     O << "QWORD PTR ";
-    printMemReference(MI, OpNo, "subreg64");
+    printLeaMemReference(MI, OpNo, "subreg64");
   }
 
   bool printAsmMRegister(const MachineOperand &MO, const char Mode);
@@ -103,6 +112,8 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
   void printSSECC(const MachineInstr *MI, unsigned Op);
   void printMemReference(const MachineInstr *MI, unsigned Op,
                          const char *Modifier=NULL);
+  void printLeaMemReference(const MachineInstr *MI, unsigned Op,
+                            const char *Modifier=NULL);
   void printPICJumpTableSetLabel(unsigned uid,
                                  const MachineBasicBlock *MBB) const;
   void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
@@ -130,10 +141,6 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
 
   void decorateName(std::string& Name, const GlobalValue* GV);
 
-  /// getSectionForFunction - Return the section that we should emit the
-  /// specified function body into.
-  virtual std::string getSectionForFunction(const Function &F) const;
-
   virtual void EmitString(const ConstantArray *CVA) const;
 
   // Necessary for dllexport support