X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FTarget%2FX86%2FX86AsmPrinter.h;h=ae03ca5382d4eea05bf8415501a9bddbaed524f6;hb=b74ed07bfd3af42331b1964c24c39912610a08f4;hp=4bc5b2b3d263927517e9cf6547c2e6e69242a79d;hpb=c9676deb23c63a932838d2e4995d05179217db06;p=oota-llvm.git diff --git a/lib/Target/X86/X86AsmPrinter.h b/lib/Target/X86/X86AsmPrinter.h index 4bc5b2b3d26..ae03ca5382d 100755 --- a/lib/Target/X86/X86AsmPrinter.h +++ b/lib/Target/X86/X86AsmPrinter.h @@ -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(); } @@ -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 FnStubs, GVStubs, LinkOnceStubs; + // Necessary for dllexport support + std::set DLLExportedFns, DLLExportedGVs; + inline static bool isScale(const MachineOperand &MO) { return MO.isImmediate() && (MO.getImmedValue() == 1 || MO.getImmedValue() == 2 ||