Remove the logging streamer.

llvm-svn: 147820
This commit is contained in:
Rafael Espindola 2012-01-10 00:40:39 +00:00
parent eb6540fdbf
commit 6b018e0b1d
6 changed files with 0 additions and 279 deletions

View File

@ -657,12 +657,6 @@ namespace llvm {
raw_ostream &OS, MCCodeEmitter *CE,
bool RelaxAll, bool NoExecStack);
/// createLoggingStreamer - Create a machine code streamer which just logs the
/// API calls and then dispatches to another streamer.
///
/// The new streamer takes ownership of the \arg Child.
MCStreamer *createLoggingStreamer(MCStreamer *Child, raw_ostream &OS);
/// createPureStreamer - Create a machine code streamer which will generate
/// "pure" MC object files, for use with MC-JIT and testing tools.
///

View File

@ -82,8 +82,6 @@ static cl::opt<bool> ShowMCEncoding("show-mc-encoding", cl::Hidden,
cl::desc("Show encoding in .s output"));
static cl::opt<bool> ShowMCInst("show-mc-inst", cl::Hidden,
cl::desc("Show instruction structure in .s output"));
static cl::opt<bool> EnableMCLogging("enable-mc-api-logging", cl::Hidden,
cl::desc("Enable MC API logging"));
static cl::opt<bool> VerifyMachineCode("verify-machineinstrs", cl::Hidden,
cl::desc("Verify generated machine code"),
cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL));
@ -191,9 +189,6 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
break;
}
if (EnableMCLogging)
AsmStreamer.reset(createLoggingStreamer(AsmStreamer.take(), errs()));
// Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer);
if (Printer == 0)

View File

@ -20,7 +20,6 @@ add_llvm_library(LLVMMC
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCLoggingStreamer.cpp
MCMachOStreamer.cpp
MCMachObjectTargetWriter.cpp
MCModule.cpp

View File

@ -1,257 +0,0 @@
//===- lib/MC/MCLoggingStreamer.cpp - API Logging Streamer ----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCStreamer.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
namespace {
class MCLoggingStreamer : public MCStreamer {
llvm::OwningPtr<MCStreamer> Child;
raw_ostream &OS;
public:
MCLoggingStreamer(MCStreamer *_Child, raw_ostream &_OS)
: MCStreamer(_Child->getContext()), Child(_Child), OS(_OS) {}
void LogCall(const char *Function) {
OS << Function << "\n";
}
void LogCall(const char *Function, const Twine &Message) {
OS << Function << ": " << Message << "\n";
}
virtual bool isVerboseAsm() const { return Child->isVerboseAsm(); }
virtual bool hasRawTextSupport() const { return Child->hasRawTextSupport(); }
virtual raw_ostream &GetCommentOS() { return Child->GetCommentOS(); }
virtual void AddComment(const Twine &T) {
LogCall("AddComment", T);
return Child->AddComment(T);
}
virtual void AddBlankLine() {
LogCall("AddBlankLine");
return Child->AddBlankLine();
}
virtual void ChangeSection(const MCSection *Section) {
LogCall("ChangeSection");
return Child->ChangeSection(Section);
}
virtual void InitSections() {
LogCall("InitSections");
return Child->InitSections();
}
virtual void EmitLabel(MCSymbol *Symbol) {
LogCall("EmitLabel");
return Child->EmitLabel(Symbol);
}
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {
LogCall("EmitAssemblerFlag");
return Child->EmitAssemblerFlag(Flag);
}
virtual void EmitThumbFunc(MCSymbol *Func) {
LogCall("EmitThumbFunc");
return Child->EmitThumbFunc(Func);
}
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
LogCall("EmitAssignment");
return Child->EmitAssignment(Symbol, Value);
}
virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {
LogCall("EmitWeakReference");
return Child->EmitWeakReference(Alias, Symbol);
}
virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
const MCSymbol *LastLabel,
const MCSymbol *Label,
unsigned PointerSize) {
LogCall("EmitDwarfAdvanceLineAddr");
return Child->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label,
PointerSize);
}
virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) {
LogCall("EmitSymbolAttribute");
return Child->EmitSymbolAttribute(Symbol, Attribute);
}
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
LogCall("EmitSymbolDesc");
return Child->EmitSymbolDesc(Symbol, DescValue);
}
virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {
LogCall("BeginCOFFSymbolDef");
return Child->BeginCOFFSymbolDef(Symbol);
}
virtual void EmitCOFFSymbolStorageClass(int StorageClass) {
LogCall("EmitCOFFSymbolStorageClass");
return Child->EmitCOFFSymbolStorageClass(StorageClass);
}
virtual void EmitCOFFSymbolType(int Type) {
LogCall("EmitCOFFSymbolType");
return Child->EmitCOFFSymbolType(Type);
}
virtual void EndCOFFSymbolDef() {
LogCall("EndCOFFSymbolDef");
return Child->EndCOFFSymbolDef();
}
virtual void EmitCOFFSecRel32(MCSymbol const *Symbol) {
LogCall("EmitCOFFSecRel32");
return Child->EmitCOFFSecRel32(Symbol);
}
virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
LogCall("EmitELFSize");
return Child->EmitELFSize(Symbol, Value);
}
virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {
LogCall("EmitCommonSymbol");
return Child->EmitCommonSymbol(Symbol, Size, ByteAlignment);
}
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {
LogCall("EmitLocalCommonSymbol");
return Child->EmitLocalCommonSymbol(Symbol, Size, ByteAlignment);
}
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0, unsigned ByteAlignment = 0) {
LogCall("EmitZerofill");
return Child->EmitZerofill(Section, Symbol, Size, ByteAlignment);
}
virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment = 0) {
LogCall("EmitTBSSSymbol");
return Child->EmitTBSSSymbol(Section, Symbol, Size, ByteAlignment);
}
virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {
LogCall("EmitBytes");
return Child->EmitBytes(Data, AddrSpace);
}
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
unsigned AddrSpace){
LogCall("EmitValue");
return Child->EmitValueImpl(Value, Size, AddrSpace);
}
virtual void EmitULEB128Value(const MCExpr *Value) {
LogCall("EmitULEB128Value");
return Child->EmitULEB128Value(Value);
}
virtual void EmitSLEB128Value(const MCExpr *Value) {
LogCall("EmitSLEB128Value");
return Child->EmitSLEB128Value(Value);
}
virtual void EmitGPRel32Value(const MCExpr *Value) {
LogCall("EmitGPRel32Value");
return Child->EmitGPRel32Value(Value);
}
virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
unsigned AddrSpace) {
LogCall("EmitFill");
return Child->EmitFill(NumBytes, FillValue, AddrSpace);
}
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
unsigned ValueSize = 1,
unsigned MaxBytesToEmit = 0) {
LogCall("EmitValueToAlignment");
return Child->EmitValueToAlignment(ByteAlignment, Value,
ValueSize, MaxBytesToEmit);
}
virtual void EmitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit = 0) {
LogCall("EmitCodeAlignment");
return Child->EmitCodeAlignment(ByteAlignment, MaxBytesToEmit);
}
virtual void EmitValueToOffset(const MCExpr *Offset,
unsigned char Value = 0) {
LogCall("EmitValueToOffset");
return Child->EmitValueToOffset(Offset, Value);
}
virtual void EmitFileDirective(StringRef Filename) {
LogCall("EmitFileDirective", "FileName:" + Filename);
return Child->EmitFileDirective(Filename);
}
virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
StringRef Filename) {
LogCall("EmitDwarfFileDirective",
"FileNo:" + Twine(FileNo) + " Directory:" + Directory +
" Filename:" + Filename);
return Child->EmitDwarfFileDirective(FileNo, Directory, Filename);
}
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa, unsigned Discriminator,
StringRef FileName) {
LogCall("EmitDwarfLocDirective",
"FileNo:" + Twine(FileNo) + " Line:" + Twine(Line) +
" Column:" + Twine(Column) + " Flags:" + Twine(Flags) +
" Isa:" + Twine(Isa) + " Discriminator:" + Twine(Discriminator));
return Child->EmitDwarfLocDirective(FileNo, Line, Column, Flags,
Isa, Discriminator, FileName);
}
virtual void EmitInstruction(const MCInst &Inst) {
LogCall("EmitInstruction");
return Child->EmitInstruction(Inst);
}
virtual void EmitRawText(StringRef String) {
LogCall("EmitRawText", "\"" + String + "\"");
return Child->EmitRawText(String);
}
virtual void FinishImpl() {
LogCall("FinishImpl");
return Child->FinishImpl();
}
};
} // end anonymous namespace.
MCStreamer *llvm::createLoggingStreamer(MCStreamer *Child, raw_ostream &OS) {
return new MCLoggingStreamer(Child, OS);
}

View File

@ -166,9 +166,6 @@ bool PTXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
break;
}
// MC Logging
//AsmStreamer.reset(createLoggingStreamer(AsmStreamer.take(), errs()));
// Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer);
if (Printer == 0)

View File

@ -70,9 +70,6 @@ RelaxAll("mc-relax-all", cl::desc("Relax all fixups"));
static cl::opt<bool>
NoExecStack("mc-no-exec-stack", cl::desc("File doesn't need an exec stack"));
static cl::opt<bool>
EnableLogging("enable-api-logging", cl::desc("Enable MC API logging"));
enum OutputFileType {
OFT_Null,
OFT_AssemblyFile,
@ -443,10 +440,6 @@ static int AssembleInput(const char *ProgName) {
NoExecStack));
}
if (EnableLogging) {
Str.reset(createLoggingStreamer(Str.take(), errs()));
}
OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, Ctx,
*Str.get(), *MAI));
OwningPtr<MCTargetAsmParser> TAP(TheTarget->createMCAsmParser(*STI, *Parser));