2004-08-16 23:15:22 +00:00
|
|
|
//===-- llvm/CodeGen/AsmPrinter.h - AsmPrinter Framework --------*- C++ -*-===//
|
2005-04-21 20:39:54 +00:00
|
|
|
//
|
2004-08-16 23:15:22 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 20:39:54 +00:00
|
|
|
//
|
2004-08-16 23:15:22 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2006-09-06 18:34:40 +00:00
|
|
|
// This file contains a class to be used as the base class for target specific
|
|
|
|
// asm writers. This class primarily handles common functionality used by
|
|
|
|
// all asm writers.
|
2004-08-16 23:15:22 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_ASMPRINTER_H
|
|
|
|
#define LLVM_CODEGEN_ASMPRINTER_H
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
2009-08-18 19:22:55 +00:00
|
|
|
#include "llvm/Support/DebugLoc.h"
|
2009-04-29 23:29:43 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2004-08-16 23:15:22 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2009-10-30 01:27:03 +00:00
|
|
|
class BlockAddress;
|
2008-08-17 18:44:35 +00:00
|
|
|
class GCStrategy;
|
2004-08-16 23:15:22 +00:00
|
|
|
class Constant;
|
2006-05-02 01:16:28 +00:00
|
|
|
class ConstantArray;
|
2009-08-18 19:22:55 +00:00
|
|
|
class ConstantFP;
|
2008-12-22 21:14:27 +00:00
|
|
|
class ConstantInt;
|
|
|
|
class ConstantStruct;
|
|
|
|
class ConstantVector;
|
2008-08-17 12:08:44 +00:00
|
|
|
class GCMetadataPrinter;
|
2009-08-18 19:22:55 +00:00
|
|
|
class GlobalValue;
|
2005-12-13 06:32:10 +00:00
|
|
|
class GlobalVariable;
|
2009-08-18 19:22:55 +00:00
|
|
|
class MachineBasicBlock;
|
|
|
|
class MachineFunction;
|
|
|
|
class MachineInstr;
|
2009-08-10 16:38:07 +00:00
|
|
|
class MachineLoopInfo;
|
|
|
|
class MachineLoop;
|
2009-08-18 19:22:55 +00:00
|
|
|
class MachineConstantPool;
|
2006-06-29 00:26:09 +00:00
|
|
|
class MachineConstantPoolEntry;
|
2006-09-12 21:00:35 +00:00
|
|
|
class MachineConstantPoolValue;
|
2009-08-18 19:22:55 +00:00
|
|
|
class MachineJumpTableInfo;
|
2009-06-24 19:09:55 +00:00
|
|
|
class MachineModuleInfo;
|
2009-07-13 20:25:48 +00:00
|
|
|
class MCInst;
|
2009-07-27 21:28:04 +00:00
|
|
|
class MCContext;
|
2009-07-31 18:48:30 +00:00
|
|
|
class MCSection;
|
2009-07-27 21:28:04 +00:00
|
|
|
class MCStreamer;
|
2009-09-12 23:02:08 +00:00
|
|
|
class MCSymbol;
|
2010-01-19 06:09:04 +00:00
|
|
|
class MDNode;
|
2009-01-13 21:44:10 +00:00
|
|
|
class DwarfWriter;
|
2006-09-06 18:34:40 +00:00
|
|
|
class Mangler;
|
2009-08-22 20:48:53 +00:00
|
|
|
class MCAsmInfo;
|
2009-07-28 03:13:23 +00:00
|
|
|
class TargetLoweringObjectFile;
|
2010-01-17 07:46:39 +00:00
|
|
|
class Twine;
|
2007-12-31 04:13:23 +00:00
|
|
|
class Type;
|
2009-07-14 20:18:05 +00:00
|
|
|
class formatted_raw_ostream;
|
2004-08-16 23:15:22 +00:00
|
|
|
|
2006-09-06 18:34:40 +00:00
|
|
|
/// AsmPrinter - This class is intended to be used as a driving class for all
|
|
|
|
/// asm writers.
|
2004-08-16 23:15:22 +00:00
|
|
|
class AsmPrinter : public MachineFunctionPass {
|
2007-05-03 01:11:54 +00:00
|
|
|
static char ID;
|
2007-05-01 21:15:47 +00:00
|
|
|
|
2008-08-17 12:08:44 +00:00
|
|
|
// GCMetadataPrinters - The garbage collection metadata printer table.
|
2008-08-17 18:44:35 +00:00
|
|
|
typedef DenseMap<GCStrategy*,GCMetadataPrinter*> gcp_map_type;
|
2008-08-17 12:08:44 +00:00
|
|
|
typedef gcp_map_type::iterator gcp_iterator;
|
|
|
|
gcp_map_type GCMetadataPrinters;
|
2009-07-22 20:33:26 +00:00
|
|
|
|
2009-08-19 06:36:30 +00:00
|
|
|
/// If VerboseAsm is set, a pointer to the loop info for this
|
2009-08-10 16:38:07 +00:00
|
|
|
/// function.
|
|
|
|
///
|
|
|
|
MachineLoopInfo *LI;
|
|
|
|
|
2009-09-16 06:25:03 +00:00
|
|
|
public:
|
2009-06-24 19:09:55 +00:00
|
|
|
/// MMI - If available, this is a pointer to the current MachineModuleInfo.
|
|
|
|
MachineModuleInfo *MMI;
|
|
|
|
|
2009-09-16 06:25:03 +00:00
|
|
|
protected:
|
2009-06-24 19:09:55 +00:00
|
|
|
/// DW - If available, this is a pointer to the current dwarf writer.
|
2009-02-18 23:12:06 +00:00
|
|
|
DwarfWriter *DW;
|
2009-07-13 20:25:48 +00:00
|
|
|
|
2006-01-04 22:28:25 +00:00
|
|
|
public:
|
2009-11-12 20:13:34 +00:00
|
|
|
|
2004-08-16 23:15:22 +00:00
|
|
|
/// Output stream on which we're printing assembly code.
|
|
|
|
///
|
2009-07-14 20:18:05 +00:00
|
|
|
formatted_raw_ostream &O;
|
2004-08-16 23:15:22 +00:00
|
|
|
|
|
|
|
/// Target machine description.
|
|
|
|
///
|
|
|
|
TargetMachine &TM;
|
2006-09-06 18:34:40 +00:00
|
|
|
|
2009-07-28 03:13:23 +00:00
|
|
|
/// getObjFileLowering - Return information about object file lowering.
|
2009-08-03 19:12:26 +00:00
|
|
|
TargetLoweringObjectFile &getObjFileLowering() const;
|
2009-07-28 03:13:23 +00:00
|
|
|
|
2006-09-06 18:34:40 +00:00
|
|
|
/// Target Asm Printer information.
|
|
|
|
///
|
2009-08-22 21:43:10 +00:00
|
|
|
const MCAsmInfo *MAI;
|
2004-08-16 23:15:22 +00:00
|
|
|
|
2008-03-15 00:03:38 +00:00
|
|
|
/// Target Register Information.
|
|
|
|
///
|
|
|
|
const TargetRegisterInfo *TRI;
|
|
|
|
|
2009-07-27 21:28:04 +00:00
|
|
|
/// OutContext - This is the context for the output file that we are
|
|
|
|
/// streaming. This owns all of the global MC-related objects for the
|
|
|
|
/// generated translation unit.
|
|
|
|
MCContext &OutContext;
|
|
|
|
|
|
|
|
/// OutStreamer - This is the MCStreamer object for the file we are
|
|
|
|
/// generating. This contains the transient state for the current
|
|
|
|
/// translation unit that we are generating (such as the current section
|
|
|
|
/// etc).
|
|
|
|
MCStreamer &OutStreamer;
|
|
|
|
|
2009-02-24 08:30:20 +00:00
|
|
|
/// The current machine function.
|
|
|
|
const MachineFunction *MF;
|
|
|
|
|
2004-08-16 23:15:22 +00:00
|
|
|
/// Name-mangler for global names.
|
|
|
|
///
|
|
|
|
Mangler *Mang;
|
|
|
|
|
2010-01-16 01:24:10 +00:00
|
|
|
/// The symbol for the current function. This is recalculated at the
|
2004-08-16 23:15:22 +00:00
|
|
|
/// beginning of each call to runOnMachineFunction().
|
|
|
|
///
|
2010-01-18 00:59:24 +00:00
|
|
|
MCSymbol *CurrentFnSym;
|
2005-11-21 08:24:11 +00:00
|
|
|
|
2009-08-03 23:20:21 +00:00
|
|
|
/// getCurrentSection() - Return the current section we are emitting to.
|
2009-08-18 06:15:16 +00:00
|
|
|
const MCSection *getCurrentSection() const;
|
2009-08-03 23:20:21 +00:00
|
|
|
|
2009-03-25 01:47:28 +00:00
|
|
|
|
|
|
|
/// VerboseAsm - Emit comments in assembly output if this is true.
|
|
|
|
///
|
|
|
|
bool VerboseAsm;
|
|
|
|
|
2009-06-24 22:28:12 +00:00
|
|
|
/// Private state for PrintSpecial()
|
|
|
|
// Assign a unique ID to this machine instruction.
|
|
|
|
mutable const MachineInstr *LastMI;
|
|
|
|
mutable const Function *LastFn;
|
|
|
|
mutable unsigned Counter;
|
2009-06-25 16:55:32 +00:00
|
|
|
|
2009-10-06 02:19:11 +00:00
|
|
|
// Private state for processDebugLoc()
|
2010-01-19 06:09:04 +00:00
|
|
|
mutable const MDNode *PrevDLT;
|
2009-06-24 22:28:12 +00:00
|
|
|
|
2006-01-04 22:28:25 +00:00
|
|
|
protected:
|
2009-07-14 20:18:05 +00:00
|
|
|
explicit AsmPrinter(formatted_raw_ostream &o, TargetMachine &TM,
|
2010-02-02 23:37:42 +00:00
|
|
|
MCContext &Ctx, MCStreamer &Streamer,
|
|
|
|
const MCAsmInfo *T);
|
2005-12-13 06:32:10 +00:00
|
|
|
|
2006-01-04 13:52:30 +00:00
|
|
|
public:
|
2008-08-17 12:08:44 +00:00
|
|
|
virtual ~AsmPrinter();
|
2009-03-25 01:47:28 +00:00
|
|
|
|
|
|
|
/// isVerbose - Return true if assembly output should contain comments.
|
|
|
|
///
|
|
|
|
bool isVerbose() const { return VerboseAsm; }
|
|
|
|
|
2009-09-01 01:57:56 +00:00
|
|
|
/// getFunctionNumber - Return a unique ID for the current function.
|
|
|
|
///
|
2010-01-26 04:35:26 +00:00
|
|
|
unsigned getFunctionNumber() const;
|
2009-09-01 01:57:56 +00:00
|
|
|
|
2006-01-04 13:52:30 +00:00
|
|
|
protected:
|
2008-01-07 01:30:38 +00:00
|
|
|
/// getAnalysisUsage - Record analysis usage.
|
|
|
|
///
|
|
|
|
void getAnalysisUsage(AnalysisUsage &AU) const;
|
|
|
|
|
2004-08-16 23:15:22 +00:00
|
|
|
/// doInitialization - Set up the AsmPrinter when we are working on a new
|
|
|
|
/// module. If your pass overrides this, it must make sure to explicitly
|
|
|
|
/// call this implementation.
|
|
|
|
bool doInitialization(Module &M);
|
|
|
|
|
2009-09-30 22:06:26 +00:00
|
|
|
/// EmitStartOfAsmFile - This virtual method can be overridden by targets
|
|
|
|
/// that want to emit something at the start of their file.
|
2009-11-16 22:34:32 +00:00
|
|
|
virtual void EmitStartOfAsmFile(Module &) {}
|
2009-09-30 22:06:26 +00:00
|
|
|
|
2009-09-18 20:17:03 +00:00
|
|
|
/// EmitEndOfAsmFile - This virtual method can be overridden by targets that
|
|
|
|
/// want to emit something at the end of their file.
|
2009-11-16 22:34:32 +00:00
|
|
|
virtual void EmitEndOfAsmFile(Module &) {}
|
2009-09-18 20:17:03 +00:00
|
|
|
|
2004-08-16 23:15:22 +00:00
|
|
|
/// doFinalization - Shut down the asmprinter. If you override this in your
|
|
|
|
/// pass, you must make sure to call it explicitly.
|
|
|
|
bool doFinalization(Module &M);
|
2006-09-26 23:59:50 +00:00
|
|
|
|
|
|
|
/// PrintSpecial - Print information related to the specified machine instr
|
|
|
|
/// that is independent of the operand, and may be independent of the instr
|
|
|
|
/// itself. This can be useful for portably encoding the comment character
|
|
|
|
/// or other bits of target-specific knowledge into the asmstrings. The
|
|
|
|
/// syntax used is ${:comment}. Targets can override this to add support
|
|
|
|
/// for their own strange codes.
|
2009-03-10 05:37:13 +00:00
|
|
|
virtual void PrintSpecial(const MachineInstr *MI, const char *Code) const;
|
2006-02-01 22:39:30 +00:00
|
|
|
|
|
|
|
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
|
|
|
|
/// instruction, using the specified assembler variant. Targets should
|
2006-02-24 20:21:12 +00:00
|
|
|
/// override this to format as appropriate. This method can return true if
|
2006-02-01 22:39:30 +00:00
|
|
|
/// the operand is erroneous.
|
|
|
|
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
2006-02-06 22:16:41 +00:00
|
|
|
unsigned AsmVariant, const char *ExtraCode);
|
2006-01-04 22:28:25 +00:00
|
|
|
|
2006-02-24 20:21:12 +00:00
|
|
|
/// 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);
|
|
|
|
|
2010-01-28 01:28:58 +00:00
|
|
|
/// runOnMachineFunction - Emit the specified function out to the
|
|
|
|
/// OutStreamer.
|
|
|
|
virtual bool runOnMachineFunction(MachineFunction &MF) {
|
|
|
|
SetupMachineFunction(MF);
|
|
|
|
EmitFunctionHeader();
|
|
|
|
EmitFunctionBody();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-11-21 07:51:06 +00:00
|
|
|
/// SetupMachineFunction - This should be called when a new MachineFunction
|
2004-08-16 23:15:22 +00:00
|
|
|
/// is being processed from runOnMachineFunction.
|
2005-11-21 07:51:06 +00:00
|
|
|
void SetupMachineFunction(MachineFunction &MF);
|
2005-11-21 08:24:11 +00:00
|
|
|
|
2010-01-26 23:18:44 +00:00
|
|
|
/// EmitFunctionHeader - This method emits the header for the current
|
|
|
|
/// function.
|
|
|
|
void EmitFunctionHeader();
|
2010-01-28 01:02:27 +00:00
|
|
|
|
|
|
|
/// EmitFunctionBody - This method emits the body and trailer for a
|
|
|
|
/// function.
|
|
|
|
void EmitFunctionBody();
|
2010-01-26 23:18:44 +00:00
|
|
|
|
2010-01-28 01:02:27 +00:00
|
|
|
/// EmitInstruction - Targets should implement this to emit instructions.
|
|
|
|
virtual void EmitInstruction(const MachineInstr *MI) {
|
|
|
|
assert(0 && "EmitInstruction not implemented");
|
|
|
|
}
|
|
|
|
|
2010-01-28 01:58:58 +00:00
|
|
|
/// EmitFunctionBodyStart - Targets can override this to emit stuff before
|
|
|
|
/// the first basic block in the function.
|
|
|
|
virtual void EmitFunctionBodyStart() {}
|
|
|
|
|
|
|
|
/// EmitFunctionBodyEnd - Targets can override this to emit stuff after
|
|
|
|
/// the last basic block in the function.
|
|
|
|
virtual void EmitFunctionBodyEnd() {}
|
|
|
|
|
2005-12-13 06:32:10 +00:00
|
|
|
/// EmitConstantPool - Print to the current output stream assembly
|
|
|
|
/// representations of the constants in the constant pool MCP. This is
|
|
|
|
/// used to print out constants which have been "spilled to memory" by
|
|
|
|
/// the code generator.
|
|
|
|
///
|
2010-01-28 00:19:24 +00:00
|
|
|
virtual void EmitConstantPool();
|
2010-01-28 01:02:27 +00:00
|
|
|
|
2006-04-22 18:53:45 +00:00
|
|
|
/// EmitJumpTableInfo - Print assembly representations of the jump tables
|
|
|
|
/// used by the current function to the current output stream.
|
|
|
|
///
|
2010-01-28 01:02:27 +00:00
|
|
|
void EmitJumpTableInfo();
|
2006-04-22 18:53:45 +00:00
|
|
|
|
2010-01-19 04:39:15 +00:00
|
|
|
/// EmitGlobalVariable - Emit the specified global variable to the .s file.
|
2010-01-19 05:38:33 +00:00
|
|
|
virtual void EmitGlobalVariable(const GlobalVariable *GV);
|
2010-01-19 04:39:15 +00:00
|
|
|
|
2005-12-13 06:32:10 +00:00
|
|
|
/// 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.
|
|
|
|
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
|
2009-07-13 21:48:26 +00:00
|
|
|
|
2007-01-24 13:12:32 +00:00
|
|
|
public:
|
2007-01-25 15:12:02 +00:00
|
|
|
//===------------------------------------------------------------------===//
|
|
|
|
// Emission and print routines
|
|
|
|
//
|
|
|
|
|
|
|
|
/// EmitInt8 - Emit a byte directive and value.
|
|
|
|
///
|
|
|
|
void EmitInt8(int Value) const;
|
|
|
|
|
|
|
|
/// EmitInt16 - Emit a short directive and value.
|
|
|
|
///
|
|
|
|
void EmitInt16(int Value) const;
|
|
|
|
|
|
|
|
/// EmitInt32 - Emit a long directive and value.
|
|
|
|
///
|
|
|
|
void EmitInt32(int Value) const;
|
|
|
|
|
|
|
|
/// EmitInt64 - Emit a long long directive and value.
|
|
|
|
///
|
|
|
|
void EmitInt64(uint64_t Value) const;
|
|
|
|
|
|
|
|
//===------------------------------------------------------------------===//
|
|
|
|
|
2005-11-21 07:51:06 +00:00
|
|
|
/// EmitAlignment - Emit an alignment directive to the specified power of
|
2004-08-17 19:14:29 +00:00
|
|
|
/// two boundary. For example, if you pass in 3 here, you will get an 8
|
2005-11-14 19:00:06 +00:00
|
|
|
/// byte alignment. If a global value is specified, and if that global has
|
2007-05-31 18:57:45 +00:00
|
|
|
/// an explicit alignment requested, it will unconditionally override the
|
|
|
|
/// alignment request. However, if ForcedAlignBits is specified, this value
|
|
|
|
/// has final say: the ultimate alignment will be the max of ForcedAlignBits
|
2008-02-29 19:36:59 +00:00
|
|
|
/// and the alignment computed with NumBits and the global. If UseFillExpr
|
|
|
|
/// is true, it also emits an optional second value FillValue which the
|
|
|
|
/// assembler uses to fill gaps to match alignment for text sections if the
|
|
|
|
/// has specified a non-zero fill value.
|
2007-05-31 18:57:45 +00:00
|
|
|
///
|
|
|
|
/// The algorithm is:
|
|
|
|
/// Align = NumBits;
|
|
|
|
/// if (GV && GV->hasalignment) Align = GV->getalignment();
|
|
|
|
/// Align = std::max(Align, ForcedAlignBits);
|
|
|
|
///
|
|
|
|
void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0,
|
2008-02-29 19:36:59 +00:00
|
|
|
unsigned ForcedAlignBits = 0,
|
|
|
|
bool UseFillExpr = true) const;
|
2004-08-17 19:14:29 +00:00
|
|
|
|
2008-02-01 09:10:45 +00:00
|
|
|
/// printLabel - This method prints a local label used by debug and
|
|
|
|
/// exception handling tables.
|
|
|
|
void printLabel(unsigned Id) const;
|
|
|
|
|
2008-02-02 04:07:54 +00:00
|
|
|
/// printDeclare - This method prints a local variable declaration used by
|
|
|
|
/// debug tables.
|
|
|
|
void printDeclare(const MachineInstr *MI) const;
|
|
|
|
|
2010-01-15 23:18:17 +00:00
|
|
|
/// GetGlobalValueSymbol - Return the MCSymbol for the specified global
|
|
|
|
/// value.
|
2010-02-12 15:28:40 +00:00
|
|
|
virtual MCSymbol *GetGlobalValueSymbol(const GlobalValue *GV) const;
|
2010-01-15 23:18:17 +00:00
|
|
|
|
2010-01-16 18:37:32 +00:00
|
|
|
/// GetSymbolWithGlobalValueBase - Return the MCSymbol for a symbol with
|
2010-01-15 23:25:11 +00:00
|
|
|
/// global value name as its base, with the specified suffix, and where the
|
2010-01-16 18:37:32 +00:00
|
|
|
/// symbol is forced to have private linkage if ForcePrivate is true.
|
|
|
|
MCSymbol *GetSymbolWithGlobalValueBase(const GlobalValue *GV,
|
|
|
|
StringRef Suffix,
|
|
|
|
bool ForcePrivate = true) const;
|
2010-01-15 23:25:11 +00:00
|
|
|
|
2010-01-15 23:18:17 +00:00
|
|
|
/// GetExternalSymbolSymbol - Return the MCSymbol for the specified
|
|
|
|
/// ExternalSymbol.
|
|
|
|
MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;
|
|
|
|
|
2010-01-23 05:19:23 +00:00
|
|
|
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
|
|
|
|
MCSymbol *GetCPISymbol(unsigned CPID) const;
|
|
|
|
|
|
|
|
/// GetJTISymbol - Return the symbol for the specified jump table entry.
|
|
|
|
MCSymbol *GetJTISymbol(unsigned JTID, bool isLinkerPrivate = false) const;
|
|
|
|
|
2010-01-25 21:17:10 +00:00
|
|
|
/// GetJTSetSymbol - Return the symbol for the specified jump table .set
|
|
|
|
/// FIXME: privatize to AsmPrinter.
|
|
|
|
MCSymbol *GetJTSetSymbol(unsigned UID, unsigned MBBID) const;
|
|
|
|
|
2009-10-30 01:27:03 +00:00
|
|
|
/// GetBlockAddressSymbol - Return the MCSymbol used to satisfy BlockAddress
|
|
|
|
/// uses of the specified basic block.
|
2010-02-08 23:10:08 +00:00
|
|
|
MCSymbol *GetBlockAddressSymbol(const BlockAddress *BA) const;
|
2009-10-30 01:27:03 +00:00
|
|
|
MCSymbol *GetBlockAddressSymbol(const Function *F,
|
2010-02-08 23:10:08 +00:00
|
|
|
const BasicBlock *BB) const;
|
2009-10-30 01:27:03 +00:00
|
|
|
|
2009-09-13 18:25:37 +00:00
|
|
|
/// EmitBasicBlockStart - This method prints the label for the specified
|
|
|
|
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
|
|
|
/// it if appropriate.
|
2009-09-14 03:15:54 +00:00
|
|
|
void EmitBasicBlockStart(const MachineBasicBlock *MBB) const;
|
2010-01-19 19:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Data emission.
|
|
|
|
|
|
|
|
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
|
|
|
|
void EmitGlobalConstant(const Constant* CV, unsigned AddrSpace = 0);
|
|
|
|
|
|
|
|
protected:
|
2010-01-27 07:21:55 +00:00
|
|
|
virtual void EmitFunctionEntryLabel();
|
|
|
|
|
2006-09-12 21:00:35 +00:00
|
|
|
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
|
2009-05-07 13:55:51 +00:00
|
|
|
|
2010-02-03 01:46:05 +00:00
|
|
|
/// printOffset - This is just convenient handler for printing offsets.
|
|
|
|
void printOffset(int64_t Offset) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2009-05-07 13:55:51 +00:00
|
|
|
/// processDebugLoc - Processes the debug information of each machine
|
2009-10-06 02:19:11 +00:00
|
|
|
/// instruction's DebugLoc.
|
|
|
|
void processDebugLoc(const MachineInstr *MI, bool BeforePrintingInsn);
|
2005-12-13 06:32:10 +00:00
|
|
|
|
2010-02-03 01:46:05 +00:00
|
|
|
void printLabelInst(const MachineInstr *MI) const;
|
|
|
|
|
2006-01-27 02:09:16 +00:00
|
|
|
/// printInlineAsm - This method formats and prints the specified machine
|
|
|
|
/// instruction that is an inline asm.
|
|
|
|
void printInlineAsm(const MachineInstr *MI) const;
|
2008-03-15 00:03:38 +00:00
|
|
|
|
|
|
|
/// printImplicitDef - This method prints the specified machine instruction
|
|
|
|
/// that is an implicit def.
|
2009-11-06 00:04:05 +00:00
|
|
|
void printImplicitDef(const MachineInstr *MI) const;
|
2009-11-04 19:24:37 +00:00
|
|
|
|
|
|
|
/// printKill - This method prints the specified kill machine instruction.
|
2009-11-06 00:04:05 +00:00
|
|
|
void printKill(const MachineInstr *MI) const;
|
2009-11-04 19:24:37 +00:00
|
|
|
|
2010-01-28 00:05:10 +00:00
|
|
|
/// EmitVisibility - This emits visibility information about symbol, if
|
|
|
|
/// this is suported by the target.
|
|
|
|
void EmitVisibility(MCSymbol *Sym, unsigned Visibility) const;
|
|
|
|
|
|
|
|
void EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const;
|
2010-01-26 23:47:12 +00:00
|
|
|
|
2010-01-26 05:10:10 +00:00
|
|
|
void EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|
|
|
const MachineBasicBlock *MBB,
|
|
|
|
unsigned uid) const;
|
2006-09-26 03:38:18 +00:00
|
|
|
void EmitLLVMUsedList(Constant *List);
|
2005-12-13 06:32:10 +00:00
|
|
|
void EmitXXStructorList(Constant *List);
|
2008-08-17 18:44:35 +00:00
|
|
|
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy *C);
|
2004-08-16 23:15:22 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|