Get rid of the .size stuff in the assembly output and format the instructions better.

This commit is contained in:
Jeremy Rand 2016-04-22 00:05:07 -04:00
parent 48276b8f1f
commit 30e52d00c8
4 changed files with 18 additions and 3 deletions

View File

@ -27,6 +27,9 @@ WDC65816MCAsmInfo::WDC65816MCAsmInfo(StringRef TT) {
// Disable the ".file <filename>" parameter
HasSingleParameterDotFile = false;
// Diable the ".size" parameter
HasDotTypeDotSizeDirective = false;
#if 0 // WDC_TODO - Do I need any of this?
Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t";

View File

@ -71,3 +71,12 @@ void WDC65816TargetAsmStreamer::EmitSegEndDirective(void)
OS << "end";
OS << '\n';
}
void WDC65816TargetAsmStreamer::EmitInstruction(StringRef instruction)
{
instruction = instruction.ltrim();
OS << indent;
OS << instruction;
OS << '\n';
}

View File

@ -24,6 +24,8 @@ namespace llvm {
virtual void EmitKeepDirective(StringRef filename) = 0;
virtual void EmitSegStartDirective(StringRef filename) = 0;
virtual void EmitSegEndDirective(void) = 0;
virtual void EmitInstruction(StringRef instruction) = 0;
};
class WDC65816TargetAsmStreamer : public WDC65816TargetStreamer {
@ -40,6 +42,8 @@ namespace llvm {
virtual void EmitKeepDirective(StringRef filename);
virtual void EmitSegStartDirective(StringRef filename);
virtual void EmitSegEndDirective(void);
virtual void EmitInstruction(StringRef instruction);
};
}

View File

@ -61,9 +61,8 @@ namespace {
raw_svector_ostream OS(Str);
printInstruction(MI, OS);
StringRef instrString = OS.str().ltrim();
OutStreamer.EmitRawText(" " + instrString);
WDC65816TargetStreamer &streamer = getTargetStreamer();
streamer.EmitInstruction(OS.str());
}
};