[llvm-commits] [PATCH]: dont crash when printing PPC::MFCRpseudo comment

Roman Divacky rdivacky at freebsd.org
Mon Aug 22 10:26:27 PDT 2011


sorry, the patch is completely wrong. I apology for the noise :(

On Mon, Aug 22, 2011 at 06:57:23PM +0200, Roman Divacky wrote:
> Hi,
> 
> on PPC the MFCRpseudo instruction has 1 operand but the printer incorrectly
> tries to print the second operand as a comment, this patch fixes it:
> 
> Index: PPCAsmPrinter.cpp
> ===================================================================
> --- PPCAsmPrinter.cpp   (revision 138231)
> +++ PPCAsmPrinter.cpp   (working copy)
> @@ -369,7 +369,7 @@
>      // Transform: %R3 = MFCRpseud %CR7
>      // Into:      %R3 = MFCR      ;; cr7
>      OutStreamer.AddComment(PPCInstPrinter::
> -                           getRegisterName(MI->getOperand(1).getReg()));
> +                           getRegisterName(MI->getOperand(0).getReg()));
>      TmpInst.setOpcode(PPC::MFCR);
>      TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(0).getReg()));
>      OutStreamer.EmitInstruction(TmpInst);
> 
> 
> OK to commit?
> 
> roman
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list