<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 24, 2015, at 10:37 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Aug 24, 2015 at 10:06 PM Steve King <<a href="mailto:steve@metrokings.com" class="">steve@metrokings.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 24, 2015 at 7:53 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:<br class="">
> Bike shed: how about pass the function around instead.<br class="">
<br class="">
Mehdi Amini advised to pass attributes instead of the function.<br class=""></blockquote><div class=""><br class=""></div><div class=""> Huh. I wonder why? My logic: ISel lowering in general is subtarget based so we're already doing a lot of function based things around this. Also it means that you have to explicitly ask for the attribute set (which you obviously didn't have in either place) rather than the single place. I'm not wedded to it, but curious :)</div><div class=""><br class=""></div></div></div></div></blockquote><br class=""></div><div>Just general API design I guess, I’m less familiar with similar methods in the backend as you are, but if I see a method taking a Function I will wonder why it need to poke at the function. </div><div>The intent seem more clear to me if the argument can be more specific. For instance, I wouldn’t pass a Module as parameter to a function that needs to access the DataLayout.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div></body></html>