<div class="gmail_quote">On Thu, Apr 9, 2009 at 7:19 PM, Dale Johannesen <span dir="ltr"><<a href="mailto:dalej@apple.com">dalej@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">
<div>
<div></div>
<div class="h5"><br>
<div>
<div>On Apr 9, 2009, at 11:11 AMPDT, Aaron Gray wrote:</div><br>
<blockquote type="cite">
<div class="gmail_quote">On Thu, Apr 9, 2009 at 4:34 PM, Anton Korobeynikov <span dir="ltr"><<a href="mailto:anton@korobeynikov.info" target="_blank">anton@korobeynikov.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello, Aaron<br>
<div><br>> How/where are function prologs and epilogs generated, is it bespoke C++ code<br>> or TableGen generated ?<br>><br>> If someone could point me in the right direction please.<br></div>Calling convention is really-really far from prologue/epilogue emission :) So:<br>

<br>1. Calling conventions<br>Partly tablegen / partly C++ code. Look for<br>CodeGen/SelectionDAG/CallingConvLower.cpp,<br>Target/X86/X86CallingConv.td and around. Usually this code is run<br>during different phases of sdag lowering.<br>

<br>2. Prologue / epilogue.<br>Pure C++ code. Look into CodeGen/PrologEpilogInserter.cpp (quite<br>obviously, right?) with bunch of target-specialized hooks, for<br>example, ones located in Target/X86/X86RegisterInfo.cpp. Information<br>

about this is needed on different stages, some - even before regalloc,<br>some - in the late end of the codegen.<br><br>Hope this will help.<br></blockquote>
<div>Yes, great. One other question. AFAICS this does not allow specialization say for a new Windows platform (Not MinGW or Cygwin) /Target to produce different code from X86 Linux.</div></div></blockquote><br></div></div>

</div>
<div>You would add a new Subtarget to do this.  That will affect a fair amount of code but it should all be in Target/X86.</div></div></blockquote>
<div> </div>
<div>Yes, I see now. Thanks,</div>
<div> </div>
<div>Aaron</div>
<div> </div></div>