[llvm] r214671 - CodeGen: silence a warning
David Blaikie
dblaikie at gmail.com
Mon Aug 4 09:39:46 PDT 2014
Any idea if this warning showed up with Clang too?
Richard - any idea why (if not) this doesn't show up with Clang?
On Sun, Aug 3, 2014 at 4:00 PM, Saleem Abdulrasool
<compnerd at compnerd.org> wrote:
> Author: compnerd
> Date: Sun Aug 3 18:00:38 2014
> New Revision: 214671
>
> URL: http://llvm.org/viewvc/llvm-project?rev=214671&view=rev
> Log:
> CodeGen: silence a warning
>
> GCC 4.8.2 objects to the tautological condition in the assert as the unsigned
> value is guaranteed to be >= 0. Simplify the assertion by dropping the
> tautological condition.
>
> Modified:
> llvm/trunk/lib/CodeGen/MachineCombiner.cpp
>
> Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=214671&r1=214670&r2=214671&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Sun Aug 3 18:00:38 2014
> @@ -144,8 +144,7 @@ MachineCombiner::getDepth(SmallVectorImp
> InstrIdxForVirtReg.find(MO.getReg());
> if (II != InstrIdxForVirtReg.end()) {
> // Operand is new virtual register not in trace
> - assert(II->second >= 0 && II->second < InstrDepth.size() &&
> - "Bad Index");
> + assert(II->second < InstrDepth.size() && "Bad Index");
> MachineInstr *DefInstr = InsInstrs[II->second];
> assert(DefInstr &&
> "There must be a definition for a new virtual register");
>
>
> _______________________________________________
> 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