X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FMCAsmStreamer.cpp;h=e33063694e6ee9194735ca6d26d1d510c639eac7;hb=5bd1a50ca220d9a2280b9639da57284ad30961ab;hp=9a65a315897208d7b1c4372e7ce702562cbb875b;hpb=4b61d2618c27a7bea59138beb6a2d808b04bf5e1;p=oota-llvm.git diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 9a65a315897..e33063694e6 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -78,6 +78,9 @@ public: } EmitCommentsAndEOL(); } + + void EmitSyntaxDirective() override; + void EmitCommentsAndEOL(); /// isVerboseAsm - Return true if this streamer supports verbose assembly at @@ -250,15 +253,9 @@ public: void MCAsmStreamer::AddComment(const Twine &T) { if (!IsVerboseAsm) return; - // Make sure that CommentStream is flushed. - CommentStream.flush(); - T.toVector(CommentToEmit); // Each comment goes on its own line. CommentToEmit.push_back('\n'); - - // Tell the comment stream that the vector changed underneath it. - CommentStream.resync(); } void MCAsmStreamer::EmitCommentsAndEOL() { @@ -267,7 +264,6 @@ void MCAsmStreamer::EmitCommentsAndEOL() { return; } - CommentStream.flush(); StringRef Comments = CommentToEmit; assert(Comments.back() == '\n' && @@ -282,8 +278,6 @@ void MCAsmStreamer::EmitCommentsAndEOL() { } while (!Comments.empty()); CommentToEmit.clear(); - // Tell the comment stream that the vector changed underneath it. - CommentStream.resync(); } static inline int64_t truncateToSize(int64_t Value, unsigned Bytes) { @@ -480,6 +474,14 @@ void MCAsmStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { EmitEOL(); } +void MCAsmStreamer::EmitSyntaxDirective() { + if (MAI->getAssemblerDialect() == 1) + OS << "\t.intel_syntax noprefix\n"; + // FIXME: Currently emit unprefix'ed registers. + // The intel_syntax directive has one optional argument + // with may have a value of prefix or noprefix. +} + void MCAsmStreamer::BeginCOFFSymbolDef(const MCSymbol *Symbol) { OS << "\t.def\t "; Symbol->print(OS, MAI); @@ -503,7 +505,8 @@ void MCAsmStreamer::EndCOFFSymbolDef() { } void MCAsmStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) { - OS << "\t.safeseh\t" << *Symbol; + OS << "\t.safeseh\t"; + Symbol->print(OS, MAI); EmitEOL(); } @@ -1216,7 +1219,6 @@ void MCAsmStreamer::AddEncodingComment(const MCInst &Inst, SmallVector Fixups; raw_svector_ostream VecOS(Code); Emitter->encodeInstruction(Inst, VecOS, Fixups, STI); - VecOS.flush(); // If we are showing fixups, create symbolic markers in the encoded // representation. We do this by making a per-bit map to the fixup item index,