[llvm-commits] [llvm] r141313 - /llvm/trunk/lib/VMCore/Core.cpp

Matt Beaumont-Gay matthewbg at google.com
Fri Oct 7 09:30:19 PDT 2011


On Fri, Oct 7, 2011 at 00:38, Duncan Sands <baldrick at free.fr> wrote:
>
> Hi Matt,
>
> > --- llvm/trunk/lib/VMCore/Core.cpp (original)
> > +++ llvm/trunk/lib/VMCore/Core.cpp Thu Oct  6 15:59:09 2011
> > @@ -666,6 +666,7 @@
> >       default:
> >           assert(false&&  "Unhandled Opcode.");
> >       }
> > +    return static_cast<LLVMOpcode>(0);
> >   }
> >
> >   static int map_from_llvmopcode(LLVMOpcode code)
> > @@ -677,6 +678,7 @@
> >       default:
> >           assert(false&&  "Unhandled Opcode.");
> >       }
> > +    return 0;
> >   }
>
> the usual LLVM style is to put the default case at the start of the switch
> rather than at the end.  That way in a -Asserts build control will just
> fall through to the first case, so you won't get a warning.

Bikeshed duly repainted in r141366 ;)

-Matt




More information about the llvm-commits mailing list