split random COFF asmprinter state out to X86COFFMachineModuleInfo.h.
[oota-llvm.git] / lib / Target / X86 / AsmPrinter / X86ATTAsmPrinter.h
index 0dd35a7aa366d101b7a5842bd8a37d8aa42af0fe..3a2698675062e2e00cee32e46ad9c97e6b5069ee 100644 (file)
@@ -29,7 +29,6 @@ namespace llvm {
 class MachineJumpTableInfo;
 class MCContext;
 class MCInst;
-class MCOperand;
 class MCStreamer;
 class MCSymbol;
 
@@ -45,6 +44,8 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
   virtual const char *getPassName() const {
     return "X86 AT&T-Style Assembly Printer";
   }
+  
+  const X86Subtarget &getSubtarget() const { return *Subtarget; }
 
   void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
@@ -57,78 +58,15 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
     AsmPrinter::getAnalysisUsage(AU);
   }
 
-  bool doFinalization(Module &M);
-
-  /// printInstruction - This method is automatically generated by tablegen
-  /// from the instruction set description.  This method returns true if the
-  /// machine instruction was sufficiently described to print it, otherwise it
-  /// returns false.
-  void printInstruction(const MachineInstr *MI);
-
-  void printInstructionThroughMCStreamer(const MachineInstr *MI);
-
   
-  // New MCInst printing stuff.
-  void printInstruction(const MCInst *MI);
-  MCSymbol *GetPICBaseSymbol();
-  MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO);
-  MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO);
-  MCSymbol *GetJumpTableSymbol(const MachineOperand &MO);
-  MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO);
-  MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym);
+  virtual void EmitEndOfAsmFile(Module &M);
+  
+  void printInstructionThroughMCStreamer(const MachineInstr *MI);
 
 
-  virtual void printMCInst(const MCInst *MI) { printInstruction(MI); }
+  void printMCInst(const MCInst *MI);
 
   void printSymbolOperand(const MachineOperand &MO);
-  void printOperand(const MCInst *MI, unsigned OpNo,
-                    const char *Modifier = 0);
-  void printMemReference(const MCInst *MI, unsigned Op);
-  void printLeaMemReference(const MCInst *MI, unsigned Op);
-  void printSSECC(const MCInst *MI, unsigned Op);
-  void printPICLabel(const MCInst *MI, unsigned Op);
-  void print_pcrel_imm(const MCInst *MI, unsigned OpNo);
-  
-  void printopaquemem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  
-  void printi8mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printi16mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printi32mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printi64mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printi128mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printf32mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printf64mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printf80mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printf128mem(const MCInst *MI, unsigned OpNo) {
-    printMemReference(MI, OpNo);
-  }
-  void printlea32mem(const MCInst *MI, unsigned OpNo) {
-    printLeaMemReference(MI, OpNo);
-  }
-  void printlea64mem(const MCInst *MI, unsigned OpNo) {
-    printLeaMemReference(MI, OpNo);
-  }
-  void printlea64_32mem(const MCInst *MI, unsigned OpNo) {
-    printLeaMemReference(MI, OpNo);
-  }
   
   
 
@@ -215,28 +153,6 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
 
   void emitFunctionHeader(const MachineFunction &MF);
 
-  // Necessary for Darwin to print out the apprioriate types of linker stubs
-  StringMap<std::string> FnStubs, GVStubs, HiddenGVStubs;
-
-  // Necessary for dllexport support
-  StringSet<> CygMingStubs, DLLExportedFns, DLLExportedGVs;
-
-  // We have to propagate some information about MachineFunction to
-  // AsmPrinter. It's ok, when we're printing the function, since we have
-  // access to MachineFunction and can get the appropriate MachineFunctionInfo.
-  // Unfortunately, this is not possible when we're printing reference to
-  // Function (e.g. calling it and so on). Even more, there is no way to get the
-  // corresponding MachineFunctions: it can even be not created at all. That's
-  // why we should use additional structure, when we're collecting all necessary
-  // information.
-  //
-  // This structure is using e.g. for name decoration for stdcall & fastcall'ed
-  // function, since we have to use arguments' size for decoration.
-  typedef std::map<const Function*, X86MachineFunctionInfo> FMFInfoMap;
-  FMFInfoMap FunctionInfoMap;
-
-  void DecorateCygMingName(std::string &Name, const GlobalValue *GV);
-  void DecorateCygMingName(SmallVectorImpl<char> &Name, const GlobalValue *GV);
 };
 
 } // end namespace llvm