[llvm] r229979 - Fix build with gcc. This has a -Wsequence-point error on 'MII', which is a good point.

Eric Christopher echristo at gmail.com
Thu Feb 19 23:38:57 PST 2015


Yeesh. Thanks Nick! :)

Man, do we need a warning for that.

-eric

On Thu Feb 19 2015 at 11:22:33 PM Nick Lewycky <nicholas at mxc.ca> wrote:

> Author: nicholas
> Date: Fri Feb 20 01:17:40 2015
> New Revision: 229979
>
> URL: http://llvm.org/viewvc/llvm-project?rev=229979&view=rev
> Log:
> Fix build with gcc. This has a -Wsequence-point error on 'MII', which is a
> good point.
>
> Modified:
>     llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp?rev=229979&r1=229978&r2=229979&
> view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Fri Feb 20
> 01:17:40 2015
> @@ -152,11 +152,9 @@ void AsmPrinter::EmitInlineAsm(StringRef
>    // We may create a new MCInstrInfo here since we might be at the module
> level
>    // and not have a MachineFunction to initialize the TargetInstrInfo
> from and
>    // we only need MCInstrInfo for asm parsing.
> -  const MCInstrInfo *MII = MF
> -                               ? MII = static_cast<const MCInstrInfo *>(
> -                                     MF->getSubtarget().getInstrInfo())
> -                               : MII = static_cast<const MCInstrInfo *>(
> -                                     TM.getTarget().createMCInstrInfo());
> +  const MCInstrInfo *MII =
> +      MF ? static_cast<const MCInstrInfo *>(MF->getSubtarget().
> getInstrInfo())
> +         : static_cast<const MCInstrInfo *>(TM.getTarget().
> createMCInstrInfo());
>    std::unique_ptr<MCTargetAsmParser> TAP(TM.getTarget().
> createMCAsmParser(
>        *STI, *Parser, *MII, TM.Options.MCOptions));
>    if (!TAP)
>
>
> _______________________________________________
> 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/20150220/da2957cf/attachment.html>


More information about the llvm-commits mailing list