Adding dllimport, dllexport and external weak linkage types.
[oota-llvm.git] / lib / Target / X86 / X86AsmPrinter.h
index 4bc5b2b3d263927517e9cf6547c2e6e69242a79d..ae03ca5382d4eea05bf8415501a9bddbaed524f6 100755 (executable)
@@ -29,33 +29,19 @@ namespace llvm {
 
 extern Statistic<> EmittedInsts;
 
-/// X86DwarfWriter - Dwarf debug info writer customized for Darwin/Mac OS X
-///
-struct X86DwarfWriter : public DwarfWriter {
-  X86DwarfWriter(std::ostream &o, AsmPrinter *ap) : DwarfWriter(o, ap) {
-      needsSet = true;
-      DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
-      DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
-      DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
-      DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
-      DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
-      DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
-      DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
-      DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
-      DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
-      DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
-      DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
-      TextSection = ".text";
-      DataSection = ".data";
-  }
-  virtual void virtfn();  // out of line virtual fn.
-};
-
-struct X86SharedAsmPrinter : public AsmPrinter {
-  X86DwarfWriter DW;
-
-  X86SharedAsmPrinter(std::ostream &O, X86TargetMachine &TM)
-    : AsmPrinter(O, TM), DW(O, this) {
+// FIXME: Move this to CodeGen/AsmPrinter.h
+namespace PICStyle {
+  enum X86AsmPICStyle {
+    Stub, GOT
+  };
+}
+
+struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter {
+  DwarfWriter DW;
+
+  X86SharedAsmPrinter(std::ostream &O, X86TargetMachine &TM,
+                      const TargetAsmInfo *T)
+    : AsmPrinter(O, TM, T), DW(O, this, T), X86PICStyle(PICStyle::GOT) {
     Subtarget = &TM.getSubtarget<X86Subtarget>();
   }
 
@@ -70,13 +56,16 @@ struct X86SharedAsmPrinter : public AsmPrinter {
     MachineFunctionPass::getAnalysisUsage(AU);
   }
 
-  const char *DefaultTextSection;   // "_text" for MASM, ".text" for others.
-  const char *DefaultDataSection;   // "_data" for MASM, ".data" for others.
+  PICStyle::X86AsmPICStyle X86PICStyle;
+  
   const X86Subtarget *Subtarget;
 
   // Necessary for Darwin to print out the apprioriate types of linker stubs
   std::set<std::string> FnStubs, GVStubs, LinkOnceStubs;
 
+  // Necessary for dllexport support
+  std::set<std::string> DLLExportedFns, DLLExportedGVs;
+  
   inline static bool isScale(const MachineOperand &MO) {
     return MO.isImmediate() &&
           (MO.getImmedValue() == 1 || MO.getImmedValue() == 2 ||