namespace llvm {
class Constant;
+ class ConstantArray;
class Mangler;
class GlobalVariable;
class AsmPrinter : public MachineFunctionPass {
+ protected:
/// CurrentSection - The current section we are emitting to. This is
/// controlled and used by the SwitchSection method.
std::string CurrentSection;
+ private:
/// FunctionNumber - This provides a unique ID for each function emitted in
/// this translation unit. It is autoincremented by SetupMachineFunction,
/// and can be accessed with getFunctionNumber() and
const char *FunctionAddrPrefix; // Defaults to ""
const char *FunctionAddrSuffix; // Defaults to ""
+ /// InlineAsmStart/End - If these are nonempty, they contain a directive to
+ /// emit before and after an inline assmebly statement.
+ const char *InlineAsmStart; // Defaults to "#APP\n"
+ const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
+
//===--- Data Emission Directives -------------------------------------===//
/// ZeroDirective - this should be set to the directive used to get some
/// before emitting the constant pool for a function.
const char *ConstantPoolSection; // Defaults to "\t.section .rodata\n"
+ /// JumpTableSection - This is the section that we SwitchToSection right
+ /// before emitting the jump tables for a function.
+ const char *JumpTableSection; // Defaults to "\t.section .rodata\n"
+
/// StaticCtorsSection - This is the directive that is emitted to switch to
/// a section to emit the static constructor list.
/// Defaults to "\t.section .ctors,\"aw\",@progbits".
/// If the new section is an empty string, this method forgets what the
/// current section is, but does not emit a .section directive.
///
- void SwitchSection(const char *NewSection, const GlobalValue *GV);
+ virtual void SwitchSection(const char *NewSection, const GlobalValue *GV);
/// getPreferredAlignmentLog - Return the preferred alignment of the
/// specified global, returned in log form. This includes an explicitly
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
/// instruction, using the specified assembler variant. Targets should
- /// overried this to format as appropriate. This method can return true if
+ /// override this to format as appropriate. This method can return true if
/// the operand is erroneous.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
+ /// PrintAsmMemoryOperand - Print the specified operand of MI, an INLINEASM
+ /// instruction, using the specified assembler variant as an address.
+ /// Targets should override this to format as appropriate. This method can
+ /// return true if the operand is erroneous.
+ virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode);
+
/// SetupMachineFunction - This should be called when a new MachineFunction
/// is being processed from runOnMachineFunction.
void SetupMachineFunction(MachineFunction &MF);
///
void EmitConstantPool(MachineConstantPool *MCP);
+ /// EmitJumpTableInfo - Print assembly representations of the jump tables
+ /// used by the current function to the current output stream.
+ ///
+ void EmitJumpTableInfo(MachineJumpTableInfo *MJTI);
+
/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
/// special global used by LLVM. If so, emit it and return true, otherwise
/// do nothing and return false.
/// EmitZeros - Emit a block of zeros.
///
- void EmitZeros(uint64_t NumZeros) const;
+ virtual void EmitZeros(uint64_t NumZeros) const;
+
+ /// EmitString - Emit a zero-byte-terminated string constant.
+ ///
+ virtual void EmitString(const ConstantArray *CVA) const;
/// EmitConstantValueOnly - Print out the specified constant, without a
/// storage class. Only constants of first-class type are allowed here.
/// printInlineAsm - This method formats and prints the specified machine
/// instruction that is an inline asm.
void printInlineAsm(const MachineInstr *MI) const;
+
+ /// printBasicBlockLabel - This method prints the label for the specified
+ /// MachineBasicBlock
+ virtual void printBasicBlockLabel(const MachineBasicBlock *MBB) const;
+
private:
void EmitXXStructorList(Constant *List);