<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>diff attached and inline<br><br>Index: src/Target.m3<br>===================================================================<br>RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/Target.m3,v<br>retrieving revision 1.123<br>diff -u -r1.123 Target.m3<br>--- src/Target.m3 7 Nov 2011 19:10:17 -0000 1.123<br>+++ src/Target.m3 16 Aug 2012 13:40:10 -0000<br>@@ -400,12 +400,12 @@<br> ELSE RETURN FALSE;<br> END;<br> <br>- InitCallingConventions (backend_mode,<br>- System IN SET OF Systems{Systems.I386_INTERIX,<br>- Systems.NT386,<br>- Systems.I386_NT,<br>- Systems.I386_CYGWIN,<br>- Systems.I386_MINGW});<br>+ MaybeInitCallingConventions (backend_mode,<br>+ System IN SET OF Systems{Systems.I386_INTERIX,<br>+ Systems.NT386,<br>+ Systems.I386_NT,<br>+ Systems.I386_CYGWIN,<br>+ Systems.I386_MINGW});<br> <br> (* fill in the "bytes" and "pack" fields *)<br> FixI (Address, max_align);<br>@@ -439,6 +439,17 @@<br> RETURN TRUE;<br> END Init;<br> <br>+CONST DefaultBackendMode = M3BackendMode_t.ExternalAssembly;<br>+CONST DefaultHasCallingConventions = FALSE;<br>+<br>+PROCEDURE MaybeInitCallingConventions(backend_mode: M3BackendMode_t;<br>+ calling_conventions: BOOLEAN) =<br>+BEGIN<br>+ IF backend_mode # DefaultBackendMode OR calling_conventions # DefaultHasCallingConventions THEN<br>+ InitCallingConventions(backend_mode, calling_conventions);<br>+ END;<br>+END MaybeInitCallingConventions;<br>+<br> PROCEDURE InitCallingConventions(backend_mode: M3BackendMode_t;<br> calling_conventions: BOOLEAN) =<br> PROCEDURE New(name: TEXT; id: [0..1]): CallingConvention =<br>@@ -520,4 +531,5 @@<br> END ConventionFromID;<br> <br> BEGIN<br>+ InitCallingConventions (DefaultBackendMode, DefaultHasCallingConventions);<br> END Target.<br><br><br><br><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Thu, 16 Aug 2012 15:43:08 +0000<br>> To: m3commit@elegosoft.com<br>> From: jkrell@elego.de<br>> Subject: [M3commit] CVS Update: cm3<br>> <br>> CVSROOT: /usr/cvs<br>> Changes by: jkrell@birch. 12/08/16 15:43:08<br>> <br>> Modified files:<br>> cm3/m3-sys/m3middle/src/: Target.m3 <br>> <br>> Log message:<br>> The only reason, seemingly, that m3cgcat needs to know TARGET,<br>> is so it can initialize m3middle.Target, so that calling conventions<br>> are known. The vast majority of targets just have one calling convention,<br>> with id 0. Go ahead and default initialize calling conventions.<br>> Know what the default is, so that we only initialize again later<br>> for the rare case.<br>> <br>> Note that we could optimize this calling convention stuff a fair amount.<br>> The vast majority of targets have one calling convention and so the whole<br>> thing is moot usually. Only NT/x86 will ever have multiple calling conventions.<br>> (i.e. we might as well provide cc with id 1, equal to id 0, so m3cgcat<br>> would work for NT/x86..but not so simple, another factor is if we<br>> are using the integrated backend, and the division of labor of reversing<br>> parameter order and struct return wrt frontend vs. backend -- really,<br>> imho, the division of labor maybe shouldn't be variable like that,<br>> the backends should be consistent..but leave it alone at least for now..)<br>> <br></div> </div></body>
</html>