Committed in r162347. Sorry we duplicated effort.<br><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 10:46 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Aug 21, 2012 at 7:28 PM, Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>> wrote:<br>

> Something like this?<br>
<br>
That looks about like what I'd half-done this afternoon (sorry, didn't<br>
mean for you (or I) to duplicate effort - just been away from a<br>
computer since 3:30).<br>
<div class="im"><br>
> Do I need to check if the MachineFunction has a valid<br>
> Function the way MachineBasicBlock checks and returns "(null)"? None of the<br>
> callers I replaced seemed to be checking for a valid result from<br>
> getFunction().<br>
<br>
</div>I just threw in an assert in the MachineFunction::getName. You could<br>
do that & this looks generally fine to commit to me (under the "post<br>
commit review for obvious changes") but you can wait for Jakob to<br>
check it if you prefer.<br>
<br>
(I'll check in any outstanding changes (if there are any) from my<br>
similar work once you check this in)<br>
<span class="HOEnZb"><font color="#888888"><br>
- David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Tue, Aug 21, 2012 at 5:06 PM, Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I'll work on this tonight.<br>
>><br>
>><br>
>> On Tue, Aug 21, 2012 at 1:25 PM, Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>><br>
>> wrote:<br>
>>><br>
>>><br>
>>> On Aug 21, 2012, at 1:14 PM, Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>> wrote:<br>
>>><br>
>>> > I think the other register allocators have the same cast and should be<br>
>>> > fixed too.<br>
>>><br>
>>> Even better, add MachineFunction::getName(), and stop including<br>
>>> "llvm/Function.h" in every backend pass.<br>
>>><br>
>>> See MachineBasicBlock::getName().<br>
>>><br>
>>> /jakob<br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> ~Craig<br>
><br>
><br>
><br>
><br>
> --<br>
> ~Craig<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>