<div dir="ltr">Ok, for now I followed this path of least resistance approach, just using the existing target prefix and width to the select the ABI and just caching it in CodeGenTypes. Its somewhat gross to have it all packed inside CGCall.cpp but its workable for the time being. <br>
<br> - Daniel<br><br><div class="gmail_quote">On Wed, Sep 17, 2008 at 4:47 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Wed, Sep 17, 2008 at 2:22 PM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:<br>
>  - Upcoming: Figure out how to refactor ABI handling into<br>
>   targets.<br>
<br>
</div>I've actually thought about this a bit.  We can't really put the ABI<br>
handling into the targets easily; the targets are in Basic, and<br>
therefore aren't allowed to know about the type system.  I think the<br>
most straightforward thing to do is to add a "CallGenStyle" flag to<br>
the TargetInfo (so X86 would have the "X86" call style, X86-64 would<br>
have the "X86-64" call style, etc.).  Then, the actual ABI code ends<br>
up in CodeGen.  This way, we get the most flexibility for the initial<br>
implementation.<br>
<br>
The downside of this approach, of course, is that adding a new target<br>
will involve modifying CodeGen; however, I don't it's a good idea to<br>
try to abstract out the rules before we have implementations for a few<br>
distinct targets.<br>
<font color="#888888"><br>
-Eli<br>
</font></blockquote></div><br></div>