[M3devel] calling conventions..
    Jay K 
    jay.krell at cornell.edu
       
    Fri Sep 14 12:58:14 CEST 2012
    
    
  
Our calling convention handling seems kind of messed up.
  results_on_left: this could be removed;    frontend could presume backends know how to return structs by value    It appears we set it "wrong" currently, e.g. on AMD64_DARWIN,    but it only matters for interop with unusual C code.          standard_structs: this could be removed;    frontend could presume backend can pass structs by value    m3x86 already implements this    It should be easier for most other backends, including m3cc.         args_left_to_right: this could be removed;   frontend could presume it is always true, and backend could   do the reversing; m3cc already does   It is currently a convenience for M3x86.m3 though.
Which leaves the only thing about a calling convention its name/id.
And then, as I proposed years ago, you might as well let allplatforms support all calling convention names, even if theyare meaningless. That way you could unfork large swaths of <*extern*>that vary only because Win32 specifies a calling convention.Heck, look at how NT/amd64 C compiler works -- it accepts and ignorescalling conventions too, for source compatibility with NT/x86.
(You see, I'm looking at all the code that looks at "backend mode".)
 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120914/bdb2072d/attachment-0001.html>
    
    
More information about the M3devel
mailing list