forked from OSchip/llvm-project
formatting cleanups, no functionality change.
llvm-svn: 79221
This commit is contained in:
parent
8710d9831b
commit
962c5bd803
|
@ -8,7 +8,6 @@
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/MC/MCStreamer.h"
|
#include "llvm/MC/MCStreamer.h"
|
||||||
|
|
||||||
#include "llvm/CodeGen/AsmPrinter.h"
|
#include "llvm/CodeGen/AsmPrinter.h"
|
||||||
#include "llvm/MC/MCContext.h"
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/MC/MCInst.h"
|
#include "llvm/MC/MCInst.h"
|
||||||
|
@ -17,78 +16,72 @@
|
||||||
#include "llvm/MC/MCValue.h"
|
#include "llvm/MC/MCValue.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class MCAsmStreamer : public MCStreamer {
|
class MCAsmStreamer : public MCStreamer {
|
||||||
raw_ostream &OS;
|
raw_ostream &OS;
|
||||||
|
AsmPrinter *Printer;
|
||||||
AsmPrinter *Printer;
|
MCSection *CurSection;
|
||||||
|
public:
|
||||||
|
MCAsmStreamer(MCContext &Context, raw_ostream &_OS, AsmPrinter *_AsmPrinter)
|
||||||
|
: MCStreamer(Context), OS(_OS), Printer(_AsmPrinter), CurSection(0) {}
|
||||||
|
~MCAsmStreamer() {}
|
||||||
|
|
||||||
MCSection *CurSection;
|
/// @name MCStreamer Interface
|
||||||
|
/// @{
|
||||||
|
|
||||||
public:
|
virtual void SwitchSection(MCSection *Section);
|
||||||
MCAsmStreamer(MCContext &Context, raw_ostream &_OS, AsmPrinter *_AsmPrinter)
|
|
||||||
: MCStreamer(Context), OS(_OS), Printer(_AsmPrinter), CurSection(0) {}
|
|
||||||
~MCAsmStreamer() {}
|
|
||||||
|
|
||||||
/// @name MCStreamer Interface
|
virtual void EmitLabel(MCSymbol *Symbol);
|
||||||
/// @{
|
|
||||||
|
|
||||||
virtual void SwitchSection(MCSection *Section);
|
virtual void EmitAssemblerFlag(AssemblerFlag Flag);
|
||||||
|
|
||||||
virtual void EmitLabel(MCSymbol *Symbol);
|
virtual void EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
|
||||||
|
bool MakeAbsolute = false);
|
||||||
|
|
||||||
virtual void EmitAssemblerFlag(AssemblerFlag Flag);
|
virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute);
|
||||||
|
|
||||||
virtual void EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
|
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
|
||||||
bool MakeAbsolute = false);
|
|
||||||
|
|
||||||
virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute);
|
virtual void EmitLocalSymbol(MCSymbol *Symbol, const MCValue &Value);
|
||||||
|
|
||||||
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
|
virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
|
||||||
|
unsigned Pow2Alignment, bool IsLocal);
|
||||||
|
|
||||||
virtual void EmitLocalSymbol(MCSymbol *Symbol, const MCValue &Value);
|
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = NULL,
|
||||||
|
unsigned Size = 0, unsigned Pow2Alignment = 0);
|
||||||
|
|
||||||
virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
|
virtual void EmitBytes(const StringRef &Data);
|
||||||
unsigned Pow2Alignment, bool IsLocal);
|
|
||||||
|
|
||||||
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = NULL,
|
virtual void EmitValue(const MCValue &Value, unsigned Size);
|
||||||
unsigned Size = 0, unsigned Pow2Alignment = 0);
|
|
||||||
|
|
||||||
virtual void EmitBytes(const StringRef &Data);
|
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||||
|
unsigned ValueSize = 1,
|
||||||
|
unsigned MaxBytesToEmit = 0);
|
||||||
|
|
||||||
virtual void EmitValue(const MCValue &Value, unsigned Size);
|
virtual void EmitValueToOffset(const MCValue &Offset,
|
||||||
|
unsigned char Value = 0);
|
||||||
|
|
||||||
|
virtual void EmitInstruction(const MCInst &Inst);
|
||||||
|
|
||||||
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
virtual void Finish();
|
||||||
unsigned ValueSize = 1,
|
|
||||||
unsigned MaxBytesToEmit = 0);
|
/// @}
|
||||||
|
};
|
||||||
|
|
||||||
virtual void EmitValueToOffset(const MCValue &Offset,
|
} // end anonymous namespace.
|
||||||
unsigned char Value = 0);
|
|
||||||
|
|
||||||
virtual void EmitInstruction(const MCInst &Inst);
|
|
||||||
|
|
||||||
virtual void Finish();
|
|
||||||
|
|
||||||
/// @}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Allow printing symbols directly to a raw_ostream with proper quoting.
|
/// Allow printing symbols directly to a raw_ostream with proper quoting.
|
||||||
static inline raw_ostream &operator<<(raw_ostream &os, const MCSymbol *S) {
|
static inline raw_ostream &operator<<(raw_ostream &os, const MCSymbol *S) {
|
||||||
S->print(os);
|
S->print(os);
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Allow printing values directly to a raw_ostream.
|
/// Allow printing values directly to a raw_ostream.
|
||||||
static inline raw_ostream &operator<<(raw_ostream &os, const MCValue &Value) {
|
static inline raw_ostream &operator<<(raw_ostream &os, const MCValue &Value) {
|
||||||
Value.print(os);
|
Value.print(os);
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue