#ifndef X86ATTASMPRINTER_H
#define X86ATTASMPRINTER_H
-#include "X86.h"
-#include "X86MachineFunctionInfo.h"
-#include "X86TargetMachine.h"
+#include "../X86.h"
+#include "../X86MachineFunctionInfo.h"
+#include "../X86TargetMachine.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
namespace llvm {
-struct MachineJumpTableInfo;
+class MachineJumpTableInfo;
-struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
- DwarfWriter DW;
+class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
+ DwarfWriter *DW;
MachineModuleInfo *MMI;
-
const X86Subtarget *Subtarget;
-
- X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM,
- const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0) {
+ public:
+ explicit X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
+ const TargetAsmInfo *T, CodeGenOpt::Level OL,
+ bool V)
+ : AsmPrinter(O, TM, T, OL, V), DW(0), MMI(0) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
}
Subtarget->isTargetCygMing()) {
AU.addRequired<MachineModuleInfo>();
}
+ AU.addRequired<DwarfWriter>();
AsmPrinter::getAnalysisUsage(AU);
}
void printf128mem(const MachineInstr *MI, unsigned OpNo) {
printMemReference(MI, OpNo);
}
+ void printlea32mem(const MachineInstr *MI, unsigned OpNo) {
+ printLeaMemReference(MI, OpNo);
+ }
+ void printlea64mem(const MachineInstr *MI, unsigned OpNo) {
+ printLeaMemReference(MI, OpNo);
+ }
void printlea64_32mem(const MachineInstr *MI, unsigned OpNo) {
- printMemReference(MI, OpNo, "subreg64");
+ printLeaMemReference(MI, OpNo, "subreg64");
}
- bool printAsmMRegister(const MachineOperand &MO, const char Mode);
+ bool printAsmMRegister(const MachineOperand &MO, char Mode);
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
void printMachineInstruction(const MachineInstr *MI);
void printSSECC(const MachineInstr *MI, unsigned Op);
void printMemReference(const MachineInstr *MI, unsigned Op,
- const char *Modifier=NULL);
+ const char *Modifier=NULL, bool NotRIPRel = false);
+ void printLeaMemReference(const MachineInstr *MI, unsigned Op,
+ const char *Modifier=NULL, bool NotRIPRel = false);
void printPICJumpTableSetLabel(unsigned uid,
const MachineBasicBlock *MBB) const;
void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
void printModuleLevelGV(const GlobalVariable* GVar);
void printGVStub(const char *GV, const char *Prefix = NULL);
+ void printHiddenGVStub(const char *GV, const char *Prefix = NULL);
bool runOnMachineFunction(MachineFunction &F);
- /// getSectionForFunction - Return the section that we should emit the
- /// specified function body into.
- virtual std::string getSectionForFunction(const Function &F) const;
-
void emitFunctionHeader(const MachineFunction &MF);
// Necessary for Darwin to print out the apprioriate types of linker stubs
- StringSet<> FnStubs, GVStubs, LinkOnceStubs;
+ StringSet<> FnStubs, GVStubs, HiddenGVStubs;
// Necessary for dllexport support
StringSet<> DLLExportedFns, DLLExportedGVs;