[llvm-commits] [llvm] r94165 - in /llvm/trunk: include/llvm/MC/MCStreamer.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/MC/MCAsmStreamer.cpp tools/llvm-mc/llvm-mc.cpp
Chris Lattner
sabre at nondot.org
Thu Jan 21 23:06:15 PST 2010
Author: lattner
Date: Fri Jan 22 01:06:15 2010
New Revision: 94165
URL: http://llvm.org/viewvc/llvm-project?rev=94165&view=rev
Log:
pass "-fasm-verbose" into createAsmStreamer.
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=94165&r1=94164&r2=94165&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Fri Jan 22 01:06:15 2010
@@ -236,6 +236,7 @@
/// assembler.
MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
const MCAsmInfo &MAI, bool isLittleEndian,
+ bool isVerboseAsm,
MCInstPrinter *InstPrint = 0,
MCCodeEmitter *CE = 0);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=94165&r1=94164&r2=94165&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Jan 22 01:06:15 2010
@@ -50,6 +50,15 @@
AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
cl::init(cl::BOU_UNSET));
+static bool getVerboseAsm(bool VDef) {
+ switch (AsmVerbose) {
+ default:
+ case cl::BOU_UNSET: return VDef;
+ case cl::BOU_TRUE: return true;
+ case cl::BOU_FALSE: return false;
+ }
+}
+
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
const MCAsmInfo *T, bool VDef)
@@ -59,15 +68,12 @@
OutContext(*new MCContext()),
// FIXME: Pass instprinter to streamer.
OutStreamer(*createAsmStreamer(OutContext, O, *T,
- TM.getTargetData()->isLittleEndian(), 0)),
+ TM.getTargetData()->isLittleEndian(),
+ getVerboseAsm(VDef), 0)),
LastMI(0), LastFn(0), Counter(~0U), PrevDLT(NULL) {
DW = 0; MMI = 0;
- switch (AsmVerbose) {
- case cl::BOU_UNSET: VerboseAsm = VDef; break;
- case cl::BOU_TRUE: VerboseAsm = true; break;
- case cl::BOU_FALSE: VerboseAsm = false; break;
- }
+ VerboseAsm = getVerboseAsm(VDef);
}
AsmPrinter::~AsmPrinter() {
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=94165&r1=94164&r2=94165&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Fri Jan 22 01:06:15 2010
@@ -28,15 +28,15 @@
class MCAsmStreamer : public MCStreamer {
raw_ostream &OS;
const MCAsmInfo &MAI;
- bool IsLittleEndian;
+ bool IsLittleEndian, IsVerboseAsm;
MCInstPrinter *InstPrinter;
MCCodeEmitter *Emitter;
public:
- MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const MCAsmInfo &tai,
- bool isLittleEndian, MCInstPrinter *_Printer,
- MCCodeEmitter *_Emitter)
- : MCStreamer(Context), OS(_OS), MAI(tai), IsLittleEndian(isLittleEndian),
- InstPrinter(_Printer), Emitter(_Emitter) {}
+ MCAsmStreamer(MCContext &Context, raw_ostream &os, const MCAsmInfo &mai,
+ bool isLittleEndian, bool isVerboseAsm, MCInstPrinter *printer,
+ MCCodeEmitter *emitter)
+ : MCStreamer(Context), OS(os), MAI(mai), IsLittleEndian(isLittleEndian),
+ IsVerboseAsm(isVerboseAsm), InstPrinter(printer), Emitter(emitter) {}
~MCAsmStreamer() {}
bool isLittleEndian() const { return IsLittleEndian; }
@@ -351,7 +351,8 @@
MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS,
const MCAsmInfo &MAI, bool isLittleEndian,
- MCInstPrinter *IP,
+ bool isVerboseAsm, MCInstPrinter *IP,
MCCodeEmitter *CE) {
- return new MCAsmStreamer(Context, OS, MAI, isLittleEndian, IP, CE);
+ return new MCAsmStreamer(Context, OS, MAI, isLittleEndian, isVerboseAsm,
+ IP, CE);
}
Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=94165&r1=94164&r2=94165&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Fri Jan 22 01:06:15 2010
@@ -266,7 +266,7 @@
CE.reset(TheTarget->createCodeEmitter(*TM));
Str.reset(createAsmStreamer(Ctx, *Out, *MAI,
TM->getTargetData()->isLittleEndian(),
- IP.get(), CE.get()));
+ /*asmverbose*/true, IP.get(), CE.get()));
} else {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM));
More information about the llvm-commits
mailing list