[llvm] r238311 - We always have an InstPrinter.
Filipe Cabecinhas
filcab at gmail.com
Wed May 27 09:57:52 PDT 2015
On Wed, May 27, 2015 at 5:13 AM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:
> Author: rafael
> Date: Wed May 27 07:13:06 2015
> New Revision: 238311
>
> URL: http://llvm.org/viewvc/llvm-project?rev=238311&view=rev
> Log:
> We always have an InstPrinter.
>
> Modified:
> llvm/trunk/lib/MC/MCAsmStreamer.cpp
>
> Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=238311&r1=238310&r2=238311&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed May 27 07:13:06 2015
> @@ -65,8 +65,9 @@ public:
> AsmBackend(asmbackend), CommentStream(CommentToEmit),
> IsVerboseAsm(isVerboseAsm), ShowInst(showInst),
> UseDwarfDirectory(useDwarfDirectory) {
> - if (InstPrinter && IsVerboseAsm)
> - InstPrinter->setCommentStream(CommentStream);
> + assert(InstPrinter);
> + if (IsVerboseAsm)
> + InstPrinter->setCommentStream(CommentStream);
> }
>
Why the assert here?If there's a reason, why not in the other chunks too?
Filipe
> inline void EmitEOL() {
> @@ -945,7 +946,7 @@ void MCAsmStreamer::EmitCFIEndProcImpl(M
> }
>
> void MCAsmStreamer::EmitRegisterName(int64_t Register) {
> - if (InstPrinter && !MAI->useDwarfRegNumForCFI()) {
> + if (!MAI->useDwarfRegNumForCFI()) {
> const MCRegisterInfo *MRI = getContext().getRegisterInfo();
> unsigned LLVMRegister = MRI->getLLVMRegNum(Register, true);
> InstPrinter->printRegName(OS, LLVMRegister);
> @@ -1259,11 +1260,8 @@ void MCAsmStreamer::EmitInstruction(cons
> GetCommentOS() << "\n";
> }
>
> - // If we have an AsmPrinter, use that to print, otherwise print the
> MCInst.
> - if (InstPrinter)
> - InstPrinter->printInst(&Inst, OS, "", STI);
> - else
> - Inst.print(OS);
> + InstPrinter->printInst(&Inst, OS, "", STI);
> +
> EmitEOL();
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150527/f37880ce/attachment.html>
More information about the llvm-commits
mailing list