ZealOS/docs/Compiler/CExcept.CC.html

315 lines
33 KiB
HTML
Raw Normal View History

2021-07-03 05:07:57 +01:00
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.05">
<style type="text/css">
body {background-color:#000000;}
.cF0{color:#ffffff;background-color:#000000;}
.cF1{color:#3465a4;background-color:#000000;}
.cF2{color:#4e9a06;background-color:#000000;}
.cF3{color:#06989a;background-color:#000000;}
.cF4{color:#a24444;background-color:#000000;}
.cF5{color:#75507b;background-color:#000000;}
.cF6{color:#ce982f;background-color:#000000;}
.cF7{color:#bcc0b9;background-color:#000000;}
.cF8{color:#555753;background-color:#000000;}
.cF9{color:#729fcf;background-color:#000000;}
.cFA{color:#82bc49;background-color:#000000;}
.cFB{color:#34e2e2;background-color:#000000;}
.cFC{color:#ac3535;background-color:#000000;}
.cFD{color:#ad7fa8;background-color:#000000;}
.cFE{color:#fce94f;background-color:#000000;}
.cFF{color:#000000;background-color:#000000;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
2021-07-03 05:07:57 +01:00
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexPutToken</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc)
<a name="l2"></a>{</span><span class=cF2>//Print cur token to StdOut. (Crude)</span><span class=cF0>
<a name="l3"></a> </span><span class=cF6>'&quot;'</span><span class=cF0>;
<a name="l4"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_IDENT</span><span class=cF0> || cc-&gt;token == </span><span class=cF3>TK_STR</span><span class=cF0>)
<a name="l5"></a> </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, cc-&gt;cur_str;
<a name="l6"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_I64</span><span class=cF0>)
<a name="l7"></a> </span><span class=cF6>&quot;INT:%X&quot;</span><span class=cF0>, cc-&gt;cur_i64;
<a name="l8"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_CHAR_CONST</span><span class=cF0>)
<a name="l9"></a> </span><span class=cF6>&quot;U8:%X&quot;</span><span class=cF0>, cc-&gt;cur_i64;
<a name="l10"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_F64</span><span class=cF0>)
<a name="l11"></a> </span><span class=cF6>&quot;FLOAT:%e&quot;</span><span class=cF0>, cc-&gt;cur_f64;
<a name="l12"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF6>'\n'</span><span class=cF0>)
<a name="l13"></a> </span><span class=cF6>&quot;&lt;NEW_LINE&gt;&quot;</span><span class=cF0>;
<a name="l14"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_displayable</span><span class=cF0>, cc-&gt;token</span><span class=cF7>)</span><span class=cF0>)
<a name="l15"></a> </span><span class=cF6>''</span><span class=cF0> cc-&gt;token;
<a name="l16"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l17"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l18"></a> </span><span class=cF6>&quot;T:%X&quot;</span><span class=cF0>, cc-&gt;token;
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l20"></a> </span><span class=cF6>&quot;\&quot; &quot;</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l21"></a>}
<a name="l22"></a>
<a name="l23"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>LexPutLine</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF1>start</span><span class=cF0>)
<a name="l24"></a>{</span><span class=cF2>//Print cur pos to end of line to StdOut.</span><span class=cF0>
<a name="l25"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
<a name="l26"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr;
2021-07-03 05:07:57 +01:00
<a name="l27"></a>
<a name="l28"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF1>start</span><span class=cF0>)
<a name="l29"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l30"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;lex_include_stack-&gt;flags &amp; </span><span class=cF3>LFSF_DOC</span><span class=cF0>)
<a name="l31"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>DocPutLine</span><span class=cF0>(cc-&gt;lex_include_stack-&gt;doc, </span><span class=cF1>start</span><span class=cF0>);
<a name="l32"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l33"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l34"></a> ptr = </span><span class=cF1>start</span><span class=cF0>;
<a name="l35"></a> </span><span class=cF1>while</span><span class=cF0> (ch = *ptr++)
<a name="l36"></a> {
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'\n'</span><span class=cF0>)
<a name="l38"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr == </span><span class=cF6>'\r'</span><span class=cF0>)
<a name="l40"></a> ptr++;
<a name="l41"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l43"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'\r'</span><span class=cF0>)
<a name="l44"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr == </span><span class=cF6>'\n'</span><span class=cF0>)
<a name="l46"></a> ptr++;
<a name="l47"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l48"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l49"></a> </span><span class=cF6>''</span><span class=cF0> ch;
<a name="l50"></a> }
<a name="l51"></a> </span><span class=cF1>if</span><span class=cF0> (!ch)
<a name="l52"></a> ptr--;
<a name="l53"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l54"></a> </span><span class=cF1>return</span><span class=cF0> ptr;
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
2021-07-03 05:07:57 +01:00
<a name="l56"></a>
<a name="l57"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l58"></a>}
<a name="l59"></a>
<a name="l60"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexPutPos</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc)
<a name="l61"></a>{</span><span class=cF2>//Print token, line link and, then, </span><a href="https://tomawezome.github.io/ZealOS/Compiler/CExcept.CC.html#l23"><span class=cF4>LexPutLine</span></a><span class=cF2>().</span><span class=cF0>
<a name="l62"></a> </span><span class=cF5>LexPutToken</span><span class=cF0>(cc);
<a name="l63"></a> </span><span class=cF5>FixSet</span><span class=cF0>(cc-&gt;lex_include_stack-&gt;full_name, cc-&gt;lex_include_stack-&gt;line_num);
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
<a name="l65"></a> </span><span class=cF6>&quot;%s,%d &quot;</span><span class=cF0>, cc-&gt;lex_include_stack-&gt;full_name, cc-&gt;lex_include_stack-&gt;line_num;
<a name="l66"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l67"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l68"></a> </span><span class=cF5>PutFileLink</span><span class=cF0>(cc-&gt;lex_include_stack-&gt;full_name,, cc-&gt;lex_include_stack-&gt;line_num);
<a name="l69"></a> </span><span class=cF5>SysErr</span><span class=cF0>(</span><span class=cF6>&quot;%s,%d\n&quot;</span><span class=cF0>, cc-&gt;lex_include_stack-&gt;full_name, cc-&gt;lex_include_stack-&gt;line_num);
<a name="l70"></a> </span><span class=cF6>''</span><span class=cF0> </span><span class=cF3>CH_SPACE</span><span class=cF0>;
<a name="l71"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l72"></a> </span><span class=cF5>LexPutLine</span><span class=cF0>(cc, cc-&gt;lex_include_stack-&gt;line_start);
2021-07-03 05:07:57 +01:00
<a name="l73"></a>}
<a name="l74"></a>
<a name="l75"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexWarn</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF1>U8</span><span class=cF0> *str=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l76"></a>{</span><span class=cF2>//Print warn message, then, </span><a href="https://tomawezome.github.io/ZealOS/Compiler/CExcept.CC.html#l60"><span class=cF4>LexPutPos</span></a><span class=cF2>().</span><span class=cF0>
<a name="l77"></a> </span><span class=cF1>if</span><span class=cF0> (str)
<a name="l78"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(str);
<a name="l79"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;htc.fun)
<a name="l80"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l81"></a> </span><span class=cF6>&quot;in fun '%s'.\n&quot;</span><span class=cF0>, cc-&gt;htc.fun-&gt;str;
<a name="l82"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
<a name="l83"></a> </span><span class=cF6>&quot;%s\n&quot;</span><span class=cF0>, cc-&gt;htc.fun-&gt;src_link;
<a name="l84"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l85"></a> {
<a name="l86"></a> </span><span class=cF6>&quot;$LK,\&quot;%s\&quot;$\n&quot;</span><span class=cF0>, cc-&gt;htc.fun-&gt;src_link;
<a name="l87"></a> </span><span class=cF5>SysErr</span><span class=cF0>(</span><span class=cF6>&quot;%s\n&quot;</span><span class=cF0>, cc-&gt;htc.fun-&gt;src_link);
<a name="l88"></a> }
<a name="l89"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l90"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l91"></a> </span><span class=cF5>LexPutPos</span><span class=cF0>(cc);
<a name="l92"></a> cc-&gt;warning_count++;
2021-07-03 05:07:57 +01:00
<a name="l93"></a>}
<a name="l94"></a>
<a name="l95"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexExcept</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF1>U8</span><span class=cF0> *str=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l96"></a>{</span><span class=cF2>//Print error message, </span><a href="https://tomawezome.github.io/ZealOS/Compiler/CExcept.CC.html#l60"><span class=cF4>LexPutPos</span></a><span class=cF2>() and throw exception.</span><span class=cF0>
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_SYSTEM_SERVER</span><span class=cF7>)</span><span class=cF0>)
<a name="l98"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l99"></a> </span><span class=cF5>Raw</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>);
<a name="l100"></a> </span><span class=cF6>&quot;Note: Still in boot phase.\n&quot;</span><span class=cF0>;
<a name="l101"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l102"></a> </span><span class=cF1>if</span><span class=cF0> (str)
<a name="l103"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(str);
<a name="l104"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsRaw</span><span class=cF0>)
<a name="l105"></a> </span><span class=cF5>SysErr</span><span class=cF0>(</span><span class=cF6>&quot;Task:%08X %s\n&quot;</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>,str);
<a name="l106"></a> </span><span class=cF5>LexPutPos</span><span class=cF0>(cc);
<a name="l107"></a> cc-&gt;error_count++;
<a name="l108"></a> </span><span class=cF5>FlushMessages</span><span class=cF0>;
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_SYSTEM_SERVER</span><span class=cF7>)</span><span class=cF0>)
<a name="l110"></a> </span><span class=cF5>Debug</span><span class=cF0>(</span><span class=cF6>&quot;Type \&quot;Fix;\&quot;&quot;</span><span class=cF0>);
<a name="l111"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'Compiler'</span><span class=cF0>);
2021-07-03 05:07:57 +01:00
<a name="l112"></a>}
<a name="l113"></a>
<a name="l114"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>UndefinedExtern</span><span class=cF0>()
<a name="l115"></a>{
<a name="l116"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;Undefined Extern\nat %P\n&quot;</span><span class=cF0>, </span><span class=cF5>Caller</span><span class=cF0>);
<a name="l117"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'UndefExt'</span><span class=cF0>);
2021-07-03 05:07:57 +01:00
<a name="l118"></a>}
<a name="l119"></a>
<a name="l120"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>UnusedExternWarning</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF9>CHashClass</span><span class=cF0> *tmpc)
<a name="l121"></a>{
<a name="l122"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Unused extern '%s'\n&quot;</span><span class=cF0>, tmpc-&gt;str);
<a name="l123"></a> cc-&gt;warning_count++;
2021-07-03 05:07:57 +01:00
<a name="l124"></a>}
<a name="l125"></a>
<a name="l126"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>ParenWarning</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc)
<a name="l127"></a>{
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;opts, </span><span class=cF3>OPTf_WARN_PAREN</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !</span><span class=cF7>(</span><span class=cF0>cc-&gt;lex_include_stack-&gt;flags &amp; </span><span class=cF3>LFSF_DEFINE</span><span class=cF7>)</span><span class=cF0>)
<a name="l129"></a> </span><span class=cF5>LexWarn</span><span class=cF0>(cc, </span><span class=cF6>&quot;Unnecessary parenthesis &quot;</span><span class=cF0>);
2021-07-03 05:07:57 +01:00
<a name="l130"></a>}
<a name="l131"></a>
<a name="l132"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>ICClassPut</span><span class=cF0>(</span><span class=cF9>CHashClass</span><span class=cF0> *c)
<a name="l133"></a>{
<a name="l134"></a> </span><span class=cF9>I64</span><span class=cF0> i;
2021-07-03 05:07:57 +01:00
<a name="l135"></a>
<a name="l136"></a> </span><span class=cF1>if</span><span class=cF0> (!c)
<a name="l137"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;ptr_stars_count &gt; </span><span class=cFE>4</span><span class=cF0>)
<a name="l139"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l140"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;put_class ptrcount=%d\n&quot;</span><span class=cF0>, c-&gt;ptr_stars_count);
<a name="l141"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
2021-07-03 05:07:57 +01:00
<a name="l142"></a></span><span class=cF2>//TODO:</span><span class=cF0>
<a name="l143"></a> </span><span class=cF5>Yield</span><span class=cF0>;
<a name="l144"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l145"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; c-&gt;ptr_stars_count; i++)
<a name="l146"></a> </span><span class=cF6>'*'</span><span class=cF0>;
<a name="l147"></a> c -= c-&gt;ptr_stars_count;
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;str)
<a name="l149"></a> </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, c-&gt;str;
<a name="l150"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l151"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l152"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;put_class str=NULL\n&quot;</span><span class=cF0>);
<a name="l153"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
2021-07-03 05:07:57 +01:00
<a name="l154"></a></span><span class=cF2>//TODO:</span><span class=cF0>
<a name="l155"></a> </span><span class=cF5>Yield</span><span class=cF0>;
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l157"></a> </span><span class=cF6>''</span><span class=cF0> </span><span class=cF3>CH_SPACE</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l158"></a>}
<a name="l159"></a>
<a name="l160"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>ICArgPut</span><span class=cF0>(</span><span class=cF9>CICArg</span><span class=cF0> *a, </span><span class=cF9>I64</span><span class=cF0> type_pointed_to)
<a name="l161"></a>{
<a name="l162"></a> </span><span class=cF1>if</span><span class=cF0> (type_pointed_to)
<a name="l163"></a> </span><span class=cF6>&quot;[%Z](%Z) %Z &quot;</span><span class=cF0>,
<a name="l164"></a> a-&gt;type.raw_type, </span><span class=cF6>&quot;ST_RAW_TYPES&quot;</span><span class=cF0>, type_pointed_to, </span><span class=cF6>&quot;ST_RAW_TYPES&quot;</span><span class=cF0>, </span><span class=cF5>Bsr</span><span class=cF0>(a-&gt;type &gt;&gt; </span><span class=cFE>8</span><span class=cF0>) + </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF6>&quot;ST_TY_TYPES&quot;</span><span class=cF0>;
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l166"></a> </span><span class=cF6>&quot;%Z %Z &quot;</span><span class=cF0>, a-&gt;type.raw_type, </span><span class=cF6>&quot;ST_RAW_TYPES&quot;</span><span class=cF0>, </span><span class=cF5>Bsr</span><span class=cF0>(a-&gt;type &gt;&gt; </span><span class=cFE>8</span><span class=cF0>) + </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF6>&quot;ST_TY_TYPES&quot;</span><span class=cF0>;
<a name="l167"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>Bsr</span><span class=cF7>(</span><span class=cF0>a-&gt;type</span><span class=cF7>)</span><span class=cF0>)
<a name="l168"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l169"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_STACK</span><span class=cF0>:
<a name="l170"></a> </span><span class=cF6>&quot;STACK&quot;</span><span class=cF0>;
<a name="l171"></a> </span><span class=cF1>break</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l172"></a>
<a name="l173"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_IMM</span><span class=cF0>:
<a name="l174"></a> </span><span class=cF6>&quot;#%X&quot;</span><span class=cF0>, a-&gt;disp;
<a name="l175"></a> </span><span class=cF1>break</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l176"></a>
<a name="l177"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_REG</span><span class=cF0>:
<a name="l178"></a> </span><span class=cF6>&quot;%Z&quot;</span><span class=cF0>, a-&gt;</span><span class=cF1>reg</span><span class=cF0>, </span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>;
<a name="l179"></a> </span><span class=cF1>break</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l180"></a>
<a name="l181"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_DISP</span><span class=cF0>:
<a name="l182"></a> </span><span class=cF6>&quot;%X[%Z]&quot;</span><span class=cF0>, a-&gt;disp, a-&gt;</span><span class=cF1>reg</span><span class=cF0>, </span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>;
<a name="l183"></a> </span><span class=cF1>break</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l184"></a>
<a name="l185"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_RIP_DISP32</span><span class=cF0>:
<a name="l186"></a> </span><span class=cF6>&quot;[%X]&quot;</span><span class=cF0>, a-&gt;disp;
<a name="l187"></a> </span><span class=cF1>break</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l188"></a>
<a name="l189"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MDf_SIB</span><span class=cF0>:
<a name="l190"></a> </span><span class=cF1>if</span><span class=cF0> (a-&gt;disp)
<a name="l191"></a> </span><span class=cF6>&quot;%X&quot;</span><span class=cF0>, a-&gt;disp;
<a name="l192"></a> </span><span class=cF1>if</span><span class=cF0> (a-&gt;</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RIP</span><span class=cF0>)
<a name="l193"></a> </span><span class=cF6>'['</span><span class=cF0>;
<a name="l194"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l195"></a> </span><span class=cF6>&quot;[%Z+&quot;</span><span class=cF0>, a-&gt;</span><span class=cF1>reg</span><span class=cF0> &amp; </span><span class=cFE>15</span><span class=cF0>, </span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>;
<a name="l196"></a> </span><span class=cF6>&quot;%Z&quot;</span><span class=cF0>, a-&gt;</span><span class=cF1>reg</span><span class=cF0> &gt;&gt; </span><span class=cFE>8</span><span class=cF0> &amp; </span><span class=cFE>15</span><span class=cF0>, </span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>;
<a name="l197"></a> </span><span class=cF1>switch</span><span class=cF0> (a-&gt;</span><span class=cF1>reg</span><span class=cF0> &gt;&gt; </span><span class=cFE>14</span><span class=cF0>)
<a name="l198"></a> {
<a name="l199"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>: </span><span class=cF6>&quot;]&quot;</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l200"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0>: </span><span class=cF6>&quot;*2]&quot;</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l201"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0>: </span><span class=cF6>&quot;*4]&quot;</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l202"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>3</span><span class=cF0>: </span><span class=cF6>&quot;*8]&quot;</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l203"></a> }
<a name="l204"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l205"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l206"></a> </span><span class=cF6>''</span><span class=cF0> </span><span class=cF3>CH_SPACE</span><span class=cF0>;
2021-07-03 05:07:57 +01:00
<a name="l207"></a>}
<a name="l208"></a>
<a name="l209"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>ICPut</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF9>CIntermediateCode</span><span class=cF0> *tmpi)
<a name="l210"></a>{
<a name="l211"></a> </span><span class=cF9>I64</span><span class=cF0> opcode = tmpi-&gt;ic_code, i;
2021-07-03 05:07:57 +01:00
<a name="l212"></a>
<a name="l213"></a> </span><span class=cF1>if</span><span class=cF0> (opcode &gt;= </span><span class=cF3>IC_END_EXP</span><span class=cF0> &amp;&amp; opcode != </span><span class=cF3>IC_NOP2</span><span class=cF0>)
<a name="l214"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l215"></a> </span><span class=cF6>&quot;%15ts %016X &quot;</span><span class=cF0>, </span><span class=cFD>intermediate_code_table</span><span class=cF0>[opcode].name, tmpi-&gt;ic_data;
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;pass)
<a name="l217"></a> {
<a name="l218"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;res.type.mode)
<a name="l219"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l220"></a> </span><span class=cF6>&quot;$PURPLE$RES:$FG$&quot;</span><span class=cF0>;
<a name="l221"></a> </span><span class=cFD>ICArgPut</span><span class=cF0>(&amp;tmpi-&gt;res, </span><span class=cFE>0</span><span class=cF0>);
<a name="l222"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l223"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;arg1.type.mode)
<a name="l224"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l225"></a> </span><span class=cF6>&quot;$PURPLE$ARG1:$FG$&quot;</span><span class=cF0>;
<a name="l226"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>intermediate_code_table</span><span class=cF0>[tmpi-&gt;ic_code].type == </span><span class=cF3>IST_DEREF</span><span class=cF0> ||
<a name="l227"></a> </span><span class=cFD>intermediate_code_table</span><span class=cF0>[tmpi-&gt;ic_code].type == </span><span class=cF3>IST_ASSIGN</span><span class=cF0>)
<a name="l228"></a> </span><span class=cFD>ICArgPut</span><span class=cF0>(&amp;tmpi-&gt;arg1, tmpi-&gt;arg1_type_pointed_to);
<a name="l229"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l230"></a> </span><span class=cFD>ICArgPut</span><span class=cF0>(&amp;tmpi-&gt;arg1, </span><span class=cFE>0</span><span class=cF0>);
<a name="l231"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l232"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;arg2.type.mode)
<a name="l233"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l234"></a> </span><span class=cF6>&quot;$PURPLE$ARG2:$FG$&quot;</span><span class=cF0>;
<a name="l235"></a> </span><span class=cFD>ICArgPut</span><span class=cF0>(&amp;tmpi-&gt;arg2, </span><span class=cFE>0</span><span class=cF0>);
<a name="l236"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l237"></a> </span><span class=cF6>&quot;$PURPLE$:$FG$&quot;</span><span class=cF0>;
<a name="l238"></a> }
<a name="l239"></a> </span><span class=cFD>ICClassPut</span><span class=cF0>(tmpi-&gt;ic_class);
<a name="l240"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_LOCK</span><span class=cF0>)
<a name="l241"></a> </span><span class=cF6>&quot;$BROWN$lock$FG$ &quot;</span><span class=cF0>;
<a name="l242"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_ARG2_TO_F64</span><span class=cF0>)
<a name="l243"></a> </span><span class=cF6>&quot;$LTBLUE$a2d$FG$ &quot;</span><span class=cF0>;
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_ARG2_TO_INT</span><span class=cF0>)
<a name="l245"></a> </span><span class=cF6>&quot;$GREEN$a2i$FG$ &quot;</span><span class=cF0>;
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_ARG1_TO_F64</span><span class=cF0>)
<a name="l247"></a> </span><span class=cF6>&quot;$LTBLUE$a1d$FG$ &quot;</span><span class=cF0>;
<a name="l248"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_ARG1_TO_INT</span><span class=cF0>)
<a name="l249"></a> </span><span class=cF6>&quot;$GREEN$a1i$FG$ &quot;</span><span class=cF0>;
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
<a name="l251"></a> </span><span class=cF6>&quot;$LTBLUE$rd$FG$ &quot;</span><span class=cF0>;
<a name="l252"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
<a name="l253"></a> </span><span class=cF6>&quot;$GREEN$ri$FG$ &quot;</span><span class=cF0>;
<a name="l254"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_USE_F64</span><span class=cF0>)
<a name="l255"></a> </span><span class=cF6>&quot;[F64] &quot;</span><span class=cF0>;
<a name="l256"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_USE_UNSIGNED</span><span class=cF0>)
<a name="l257"></a> </span><span class=cF6>&quot;[unsigned] &quot;</span><span class=cF0>;
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_USE_INT</span><span class=cF0>)
<a name="l259"></a> </span><span class=cF6>&quot;[int] &quot;</span><span class=cF0>;
<a name="l260"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_RES_NOT_USED</span><span class=cF0>)
<a name="l261"></a> </span><span class=cF6>&quot;NO_RES &quot;</span><span class=cF0>;
<a name="l262"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_BY_VAL</span><span class=cF0>)
<a name="l263"></a> </span><span class=cF6>&quot;BY_VAL &quot;</span><span class=cF0>;
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_PUSH_RES</span><span class=cF0>)
<a name="l265"></a> </span><span class=cF6>&quot;PUSH &quot;</span><span class=cF0>;
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_PUSH_CMP</span><span class=cF0>)
<a name="l267"></a> </span><span class=cF6>&quot;PUSH_CMP &quot;</span><span class=cF0>;
<a name="l268"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_POP_CMP</span><span class=cF0>)
<a name="l269"></a> </span><span class=cF6>&quot;POP_CMP &quot;</span><span class=cF0>;
<a name="l270"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_DEL_PREV_INS</span><span class=cF0>)
<a name="l271"></a> </span><span class=cF6>&quot;DEL_PREV &quot;</span><span class=cF0>;
<a name="l272"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_PREV_DELETED</span><span class=cF0>)
<a name="l273"></a> </span><span class=cF6>&quot;PREV_DEL &quot;</span><span class=cF0>;
<a name="l274"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cFE>3</span><span class=cF0>; i++)
<a name="l275"></a> {
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmpi-&gt;ic_flags, </span><span class=cF3>ICf_DONT_PUSH_FLOAT0</span><span class=cF0> + i</span><span class=cF7>)</span><span class=cF0>)
<a name="l277"></a> </span><span class=cF6>&quot;DONT_PUSH#%d &quot;</span><span class=cF0>, i;
<a name="l278"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmpi-&gt;ic_flags, </span><span class=cF3>ICf_DONT_POP_FLOAT0</span><span class=cF0> + i</span><span class=cF7>)</span><span class=cF0>)
<a name="l279"></a> </span><span class=cF6>&quot;DONT_POP#%d &quot;</span><span class=cF0>, i;
<a name="l280"></a> }
<a name="l281"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags &amp; </span><span class=cF3>ICF_ALT_TEMPLATE</span><span class=cF0>)
<a name="l282"></a> </span><span class=cF6>&quot;ALT_TMP &quot;</span><span class=cF0>;
<a name="l283"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l284"></a> </span><span class=cF7>}</span><span class=cF0>
2021-07-03 05:07:57 +01:00
<a name="l285"></a>}
</span></pre></body>
</html>