[llvm-commits] [llvm] r148408 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Chad Rosier
mcrosier at apple.com
Wed Jan 25 12:57:36 PST 2012
Lang,
I believe the change is correct. Per Jakob's comment, would you mind adding a comment to the source?
Chad
On Jan 25, 2012, at 12:34 PM, Lang Hames wrote:
> Oops - this slipped through the cracks. Sorry about the late reply.
>
> Jakob nailed it (mostly) - you'd only want to continue the loop to trigger the assert.
>
> The change is correct though. Beware the double negative: The original, "#ifndef NDEBUG", reads as "if not not debugging", so the break only went in in debug mode. :)
>
> - Lang.
>
> On Wed, Jan 18, 2012 at 5:46 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>
> On Jan 18, 2012, at 2:08 PM, Bill Wendling wrote:
>
> > On Jan 18, 2012, at 11:48 AM, Lang Hames wrote:
> >
> >> Author: lhames
> >> Date: Wed Jan 18 13:48:31 2012
> >> New Revision: 148408
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=148408&view=rev
> >> Log:
> >> Fixed macro condition.
> >>
> >> Modified:
> >> llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> >>
> >> Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=148408&r1=148407&r2=148408&view=diff
> >> ==============================================================================
> >> --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
> >> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jan 18 13:48:31 2012
> >> @@ -823,7 +823,7 @@
> >> assert(!RegOp &&
> >> "Can't rematerialize instruction with multiple register operand!");
> >> RegOp = MO.getReg();
> >> -#ifndef NDEBUG
> >> +#ifdef NDEBUG
> >> break;
> >> #endif
> >> }
> >>
> > What's the purpose of having this 'break' statement only in release mode? That would appear to cause possible different behavior between release and debug modes...
>
> The only purpose of continuing the loop would be to fire the assertion above, so I actually think Lang's change is wrong.
>
> It's pretty gross, particularly without a comment.
>
> /jakob
>
>
> _______________________________________________
> 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/20120125/f58cba53/attachment.html>
More information about the llvm-commits
mailing list