nx64flw.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. {
  2. Copyright (c) 2011 by Free Pascal development team
  3. Generate Win64-specific exception handling code
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit nx64flw;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. node,nflw,ncgflw,psub;
  22. type
  23. tx64raisenode=class(tcgraisenode)
  24. function pass_1 : tnode;override;
  25. end;
  26. tx64onnode=class(tcgonnode)
  27. procedure pass_generate_code;override;
  28. end;
  29. tx64tryexceptnode=class(tcgtryexceptnode)
  30. procedure pass_generate_code;override;
  31. end;
  32. tx64tryfinallynode=class(tcgtryfinallynode)
  33. finalizepi: tcgprocinfo;
  34. constructor create(l,r:TNode);override;
  35. constructor create_implicit(l,r:TNode);override;
  36. function dogetcopy : tnode;override;
  37. function simplify(forinline: boolean): tnode;override;
  38. procedure pass_generate_code;override;
  39. end;
  40. implementation
  41. uses
  42. globtype,globals,verbose,systems,fmodule,
  43. nbas,ncal,nutils,
  44. symconst,symsym,symdef,
  45. cgbase,cgobj,cgutils,tgobj,
  46. cpubase,htypechk,
  47. pass_1,pass_2,
  48. aasmbase,aasmtai,aasmdata,aasmcpu,
  49. procinfo,cpupi,procdefutil;
  50. var
  51. endexceptlabel: tasmlabel;
  52. { tx64raisenode }
  53. function tx64raisenode.pass_1 : tnode;
  54. var
  55. statements : tstatementnode;
  56. raisenode : tcallnode;
  57. begin
  58. { difference from generic code is that address stack is not popped on reraise }
  59. if (target_info.system<>system_x86_64_win64) or assigned(left) then
  60. result:=inherited pass_1
  61. else
  62. begin
  63. result:=internalstatements(statements);
  64. raisenode:=ccallnode.createintern('fpc_reraise',nil);
  65. include(raisenode.callnodeflags,cnf_call_never_returns);
  66. addstatement(statements,raisenode);
  67. end;
  68. end;
  69. { tx64onnode }
  70. procedure tx64onnode.pass_generate_code;
  71. var
  72. exceptvarsym : tlocalvarsym;
  73. begin
  74. if (target_info.system<>system_x86_64_win64) then
  75. begin
  76. inherited pass_generate_code;
  77. exit;
  78. end;
  79. location_reset(location,LOC_VOID,OS_NO);
  80. { RTL will put exceptobject into RAX when jumping here }
  81. cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_FUNCTION_RESULT_REG);
  82. { Retrieve exception variable }
  83. if assigned(excepTSymtable) then
  84. exceptvarsym:=tlocalvarsym(excepTSymtable.SymList[0])
  85. else
  86. exceptvarsym:=nil;
  87. if assigned(exceptvarsym) then
  88. begin
  89. exceptvarsym.localloc.loc:=LOC_REFERENCE;
  90. exceptvarsym.localloc.size:=OS_ADDR;
  91. tg.GetLocal(current_asmdata.CurrAsmList,sizeof(pint),voidpointertype,exceptvarsym.localloc.reference);
  92. cg.a_load_reg_ref(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,exceptvarsym.localloc.reference);
  93. end;
  94. cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_FUNCTION_RESULT_REG);
  95. if assigned(right) then
  96. secondpass(right);
  97. { deallocate exception symbol }
  98. if assigned(exceptvarsym) then
  99. begin
  100. tg.UngetLocal(current_asmdata.CurrAsmList,exceptvarsym.localloc.reference);
  101. exceptvarsym.localloc.loc:=LOC_INVALID;
  102. end;
  103. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  104. cg.a_jmp_always(current_asmdata.CurrAsmList,endexceptlabel);
  105. end;
  106. { tx64tryfinallynode }
  107. function reset_regvars(var n: tnode; arg: pointer): foreachnoderesult;
  108. begin
  109. case n.nodetype of
  110. temprefn:
  111. make_not_regable(n,[]);
  112. calln:
  113. include(tprocinfo(arg).flags,pi_do_call);
  114. else
  115. ;
  116. end;
  117. result:=fen_true;
  118. end;
  119. function copy_parasize(var n: tnode; arg: pointer): foreachnoderesult;
  120. begin
  121. case n.nodetype of
  122. calln:
  123. tcgprocinfo(arg).allocate_push_parasize(tcallnode(n).pushed_parasize);
  124. else
  125. ;
  126. end;
  127. result:=fen_true;
  128. end;
  129. constructor tx64tryfinallynode.create(l, r: TNode);
  130. begin
  131. inherited create(l,r);
  132. if (target_info.system=system_x86_64_win64) and
  133. { Don't create child procedures for generic methods, their nested-like
  134. behavior causes compilation errors because real nested procedures
  135. aren't allowed for generics. Not creating them doesn't harm because
  136. generic node tree is discarded without generating code. }
  137. not (df_generic in current_procinfo.procdef.defoptions) then
  138. begin
  139. finalizepi:=tcgprocinfo(current_procinfo.create_for_outlining('$fin$',current_procinfo.procdef.struct,potype_exceptfilter,voidtype,r));
  140. { the init/final code is messing with asm nodes, so inform the compiler about this }
  141. include(finalizepi.flags,pi_has_assembler_block);
  142. { Regvar optimization for symbols is suppressed when using exceptions, but
  143. temps may be still placed into registers. This must be fixed. }
  144. foreachnodestatic(r,@reset_regvars,finalizepi);
  145. end;
  146. end;
  147. constructor tx64tryfinallynode.create_implicit(l, r: TNode);
  148. begin
  149. inherited create_implicit(l, r);
  150. if (target_info.system=system_x86_64_win64) then
  151. begin
  152. if df_generic in current_procinfo.procdef.defoptions then
  153. InternalError(2013012501);
  154. finalizepi:=tcgprocinfo(current_procinfo.create_for_outlining('$fin$',current_procinfo.procdef.struct,potype_exceptfilter,voidtype,r));
  155. include(finalizepi.flags,pi_do_call);
  156. { the init/final code is messing with asm nodes, so inform the compiler about this }
  157. include(finalizepi.flags,pi_has_assembler_block);
  158. finalizepi.allocate_push_parasize(32);
  159. end;
  160. end;
  161. function tx64tryfinallynode.dogetcopy: tnode;
  162. var
  163. n: tx64tryfinallynode;
  164. begin
  165. n:=tx64tryfinallynode(inherited dogetcopy);
  166. if target_info.system=system_x86_64_win64 then
  167. begin
  168. n.finalizepi:=tcgprocinfo(cprocinfo.create(finalizepi.parent));
  169. n.finalizepi.force_nested;
  170. n.finalizepi.procdef:=create_outline_procdef('$fin$',current_procinfo.procdef.struct,potype_exceptfilter,voidtype);
  171. n.finalizepi.entrypos:=finalizepi.entrypos;
  172. n.finalizepi.entryswitches:=finalizepi.entryswitches;
  173. n.finalizepi.exitpos:=finalizepi.exitpos;
  174. n.finalizepi.exitswitches:=finalizepi.exitswitches;
  175. n.finalizepi.flags:=finalizepi.flags;
  176. { node already transformed? }
  177. if assigned(finalizepi.code) then
  178. begin
  179. n.finalizepi.code:=finalizepi.code.getcopy;
  180. n.right:=ccallnode.create(nil,tprocsym(n.finalizepi.procdef.procsym),nil,nil,[],nil);
  181. firstpass(n.right);
  182. end;
  183. end;
  184. result:=n;
  185. end;
  186. function tx64tryfinallynode.simplify(forinline: boolean): tnode;
  187. begin
  188. result:=inherited simplify(forinline);
  189. if (target_info.system<>system_x86_64_win64) then
  190. exit;
  191. if (result=nil) then
  192. begin
  193. { actually, this is not really the right place to do a node transformation like this }
  194. if not(assigned(finalizepi.code)) then
  195. begin
  196. finalizepi.code:=right;
  197. foreachnodestatic(right,@copy_parasize,finalizepi);
  198. right:=ccallnode.create(nil,tprocsym(finalizepi.procdef.procsym),nil,nil,[],nil);
  199. firstpass(right);
  200. { For implicit frames, no actual code is available at this time,
  201. it is added later in assembler form. So store the nested procinfo
  202. for later use. }
  203. if implicitframe then
  204. begin
  205. current_procinfo.finalize_procinfo:=finalizepi;
  206. end;
  207. end;
  208. end;
  209. end;
  210. procedure emit_nop;
  211. var
  212. dummy: TAsmLabel;
  213. begin
  214. { To avoid optimizing away the whole thing, prepend a jumplabel with increased refcount }
  215. current_asmdata.getjumplabel(dummy);
  216. dummy.increfs;
  217. cg.a_label(current_asmdata.CurrAsmList,dummy);
  218. current_asmdata.CurrAsmList.concat(Taicpu.op_none(A_NOP,S_NO));
  219. end;
  220. procedure tx64tryfinallynode.pass_generate_code;
  221. var
  222. trylabel,
  223. endtrylabel,
  224. finallylabel,
  225. endfinallylabel,
  226. templabel,
  227. oldexitlabel: tasmlabel;
  228. oldflowcontrol: tflowcontrol;
  229. catch_frame: boolean;
  230. begin
  231. if (target_info.system<>system_x86_64_win64) then
  232. begin
  233. inherited pass_generate_code;
  234. exit;
  235. end;
  236. location_reset(location,LOC_VOID,OS_NO);
  237. { Do not generate a frame that catches exceptions if the only action
  238. would be reraising it. Doing so is extremely inefficient with SEH
  239. (in contrast with setjmp/longjmp exception handling) }
  240. catch_frame:=implicitframe and
  241. (current_procinfo.procdef.proccalloption=pocall_safecall);
  242. oldflowcontrol:=flowcontrol;
  243. flowcontrol:=[fc_inflowcontrol];
  244. templabel:=nil;
  245. current_asmdata.getjumplabel(trylabel);
  246. current_asmdata.getjumplabel(endtrylabel);
  247. current_asmdata.getjumplabel(finallylabel);
  248. current_asmdata.getjumplabel(endfinallylabel);
  249. oldexitlabel:=current_procinfo.CurrExitLabel;
  250. if implicitframe then
  251. current_procinfo.CurrExitLabel:=finallylabel;
  252. { Start of scope }
  253. { Padding with NOP is necessary here because exceptions in called
  254. procedures are seen at the next instruction, while CPU/OS exceptions
  255. like AV are seen at the current instruction.
  256. So in the following code
  257. raise_some_exception; //(a)
  258. try
  259. pchar(nil)^:='0'; //(b)
  260. ...
  261. without NOP, exceptions (a) and (b) will be seen at the same address
  262. and fall into the same scope. However they should be seen in different scopes.
  263. }
  264. emit_nop;
  265. cg.a_label(current_asmdata.CurrAsmList,trylabel);
  266. { try code }
  267. if assigned(left) then
  268. begin
  269. { fc_unwind_xx tells exit/continue/break statements to emit special
  270. unwind code instead of just JMP }
  271. if not implicitframe then
  272. flowcontrol:=flowcontrol+[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
  273. secondpass(left);
  274. flowcontrol:=flowcontrol-[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
  275. if codegenerror then
  276. exit;
  277. end;
  278. { finallylabel is only used in implicit frames as an exit point from nested try..finally
  279. statements, if any. To prevent finalizer from being executed twice, it must come before
  280. endtrylabel (bug #34772) }
  281. if catch_frame then
  282. begin
  283. current_asmdata.getjumplabel(templabel);
  284. cg.a_label(current_asmdata.CurrAsmList, finallylabel);
  285. { jump over exception handler }
  286. cg.a_jmp_always(current_asmdata.CurrAsmList,templabel);
  287. { Handle the except block first, so endtrylabel serves both
  288. as end of scope and as unwind target. This way it is possible to
  289. encode everything into a single scope record. }
  290. cg.a_label(current_asmdata.CurrAsmList,endtrylabel);
  291. if (current_procinfo.procdef.proccalloption=pocall_safecall) then
  292. begin
  293. handle_safecall_exception;
  294. cg.a_jmp_always(current_asmdata.CurrAsmList,endfinallylabel);
  295. end
  296. else
  297. InternalError(2014031601);
  298. cg.a_label(current_asmdata.CurrAsmList,templabel);
  299. end
  300. else
  301. begin
  302. { same as emit_nop but using finallylabel instead of dummy }
  303. cg.a_label(current_asmdata.CurrAsmList,finallylabel);
  304. finallylabel.increfs;
  305. current_asmdata.CurrAsmList.concat(Taicpu.op_none(A_NOP,S_NO));
  306. cg.a_label(current_asmdata.CurrAsmList,endtrylabel);
  307. end;
  308. { i32913 - if the try..finally block is also inside a try..finally or
  309. try..except block, make a note of any Exit calls so all necessary labels
  310. are generated. [Kit] }
  311. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  312. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  313. flowcontrol:=[fc_inflowcontrol];
  314. { generate finally code as a separate procedure }
  315. if not implicitframe then
  316. tcgprocinfo(current_procinfo).generate_exceptfilter(finalizepi);
  317. { right is a call to finalizer procedure }
  318. secondpass(right);
  319. if codegenerror then
  320. exit;
  321. { normal exit from safecall proc must zero the result register }
  322. if implicitframe and (current_procinfo.procdef.proccalloption=pocall_safecall) then
  323. cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,0,NR_FUNCTION_RESULT_REG);
  324. cg.a_label(current_asmdata.CurrAsmList,endfinallylabel);
  325. { generate the scope record in .xdata }
  326. tcpuprocinfo(current_procinfo).add_finally_scope(trylabel,endtrylabel,
  327. current_asmdata.RefAsmSymbol(finalizepi.procdef.mangledname,AT_FUNCTION),catch_frame);
  328. if implicitframe then
  329. current_procinfo.CurrExitLabel:=oldexitlabel;
  330. flowcontrol:=oldflowcontrol;
  331. end;
  332. { tx64tryexceptnode }
  333. procedure tx64tryexceptnode.pass_generate_code;
  334. var
  335. trylabel,
  336. exceptlabel,oldendexceptlabel,
  337. lastonlabel,
  338. exitexceptlabel,
  339. continueexceptlabel,
  340. breakexceptlabel,
  341. oldCurrExitLabel,
  342. oldContinueLabel,
  343. oldBreakLabel : tasmlabel;
  344. onlabel,
  345. filterlabel: tasmlabel;
  346. oldflowcontrol,tryflowcontrol,
  347. exceptflowcontrol : tflowcontrol;
  348. hnode : tnode;
  349. hlist : tasmlist;
  350. onnodecount : tai_const;
  351. sym : tasmsymbol;
  352. label
  353. errorexit;
  354. begin
  355. if (target_info.system<>system_x86_64_win64) then
  356. begin
  357. inherited pass_generate_code;
  358. exit;
  359. end;
  360. location_reset(location,LOC_VOID,OS_NO);
  361. oldflowcontrol:=flowcontrol;
  362. exceptflowcontrol:=[];
  363. continueexceptlabel:=nil;
  364. breakexceptlabel:=nil;
  365. include(flowcontrol,fc_inflowcontrol);
  366. { this can be called recursivly }
  367. oldBreakLabel:=nil;
  368. oldContinueLabel:=nil;
  369. oldendexceptlabel:=endexceptlabel;
  370. { save the old labels for control flow statements }
  371. oldCurrExitLabel:=current_procinfo.CurrExitLabel;
  372. current_asmdata.getjumplabel(exitexceptlabel);
  373. if assigned(current_procinfo.CurrBreakLabel) then
  374. begin
  375. oldContinueLabel:=current_procinfo.CurrContinueLabel;
  376. oldBreakLabel:=current_procinfo.CurrBreakLabel;
  377. current_asmdata.getjumplabel(breakexceptlabel);
  378. current_asmdata.getjumplabel(continueexceptlabel);
  379. end;
  380. current_asmdata.getjumplabel(exceptlabel);
  381. current_asmdata.getjumplabel(endexceptlabel);
  382. current_asmdata.getjumplabel(lastonlabel);
  383. filterlabel:=nil;
  384. { start of scope }
  385. current_asmdata.getjumplabel(trylabel);
  386. emit_nop;
  387. cg.a_label(current_asmdata.CurrAsmList,trylabel);
  388. { control flow in try block needs no special handling,
  389. just make sure that target labels are outside the scope }
  390. secondpass(left);
  391. tryflowcontrol:=flowcontrol;
  392. if codegenerror then
  393. goto errorexit;
  394. { jump over except handlers }
  395. cg.a_jmp_always(current_asmdata.CurrAsmList,endexceptlabel);
  396. { end of scope }
  397. cg.a_label(current_asmdata.CurrAsmList,exceptlabel);
  398. { set control flow labels for the except block }
  399. { and the on statements }
  400. current_procinfo.CurrExitLabel:=exitexceptlabel;
  401. if assigned(oldBreakLabel) then
  402. begin
  403. current_procinfo.CurrContinueLabel:=continueexceptlabel;
  404. current_procinfo.CurrBreakLabel:=breakexceptlabel;
  405. end;
  406. { i32913 - if the try..finally block is also inside a try..finally or
  407. try..except block, make a note of any Exit calls so all necessary labels
  408. are generated. [Kit] }
  409. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  410. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  411. flowcontrol:=[fc_inflowcontrol];
  412. { on statements }
  413. if assigned(right) then
  414. begin
  415. { emit filter table to a temporary asmlist }
  416. hlist:=TAsmList.Create;
  417. current_asmdata.getaddrlabel(filterlabel);
  418. new_section(hlist,sec_rodata_norel,filterlabel.name,4);
  419. cg.a_label(hlist,filterlabel);
  420. onnodecount:=tai_const.create_32bit(0);
  421. hlist.concat(onnodecount);
  422. hnode:=right;
  423. while assigned(hnode) do
  424. begin
  425. if hnode.nodetype<>onn then
  426. InternalError(2011103101);
  427. current_asmdata.getjumplabel(onlabel);
  428. sym:=current_asmdata.RefAsmSymbol(tonnode(hnode).excepttype.vmt_mangledname,AT_DATA,true);
  429. hlist.concat(tai_const.create_rva_sym(sym));
  430. hlist.concat(tai_const.create_rva_sym(onlabel));
  431. current_module.add_extern_asmsym(sym);
  432. cg.a_label(current_asmdata.CurrAsmList,onlabel);
  433. secondpass(hnode);
  434. inc(onnodecount.value);
  435. hnode:=tonnode(hnode).left;
  436. end;
  437. { add 'else' node to the filter list, too }
  438. if assigned(t1) then
  439. begin
  440. hlist.concat(tai_const.create_32bit(-1));
  441. hlist.concat(tai_const.create_rva_sym(lastonlabel));
  442. inc(onnodecount.value);
  443. end;
  444. { now move filter table to permanent list all at once }
  445. current_procinfo.aktlocaldata.concatlist(hlist);
  446. hlist.free;
  447. end;
  448. cg.a_label(current_asmdata.CurrAsmList,lastonlabel);
  449. if assigned(t1) then
  450. begin
  451. { here we don't have to reset flowcontrol }
  452. { the default and on flowcontrols are handled equal }
  453. secondpass(t1);
  454. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  455. if (flowcontrol*[fc_exit,fc_break,fc_continue]<>[]) then
  456. cg.a_jmp_always(current_asmdata.CurrAsmList,endexceptlabel);
  457. end;
  458. exceptflowcontrol:=flowcontrol;
  459. if fc_exit in exceptflowcontrol then
  460. begin
  461. { do some magic for exit in the try block }
  462. cg.a_label(current_asmdata.CurrAsmList,exitexceptlabel);
  463. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  464. if (fc_unwind_exit in oldflowcontrol) then
  465. cg.g_local_unwind(current_asmdata.CurrAsmList,oldCurrExitLabel)
  466. else
  467. cg.a_jmp_always(current_asmdata.CurrAsmList,oldCurrExitLabel);
  468. end;
  469. if fc_break in exceptflowcontrol then
  470. begin
  471. cg.a_label(current_asmdata.CurrAsmList,breakexceptlabel);
  472. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  473. if (fc_unwind_loop in oldflowcontrol) then
  474. cg.g_local_unwind(current_asmdata.CurrAsmList,oldBreakLabel)
  475. else
  476. cg.a_jmp_always(current_asmdata.CurrAsmList,oldBreakLabel);
  477. end;
  478. if fc_continue in exceptflowcontrol then
  479. begin
  480. cg.a_label(current_asmdata.CurrAsmList,continueexceptlabel);
  481. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  482. if (fc_unwind_loop in oldflowcontrol) then
  483. cg.g_local_unwind(current_asmdata.CurrAsmList,oldContinueLabel)
  484. else
  485. cg.a_jmp_always(current_asmdata.CurrAsmList,oldContinueLabel);
  486. end;
  487. emit_nop;
  488. cg.a_label(current_asmdata.CurrAsmList,endexceptlabel);
  489. tcpuprocinfo(current_procinfo).add_except_scope(trylabel,exceptlabel,endexceptlabel,filterlabel);
  490. errorexit:
  491. { restore all saved labels }
  492. endexceptlabel:=oldendexceptlabel;
  493. { i32913 - if the try..finally block is also inside a try..finally or
  494. try..except block, make a note of any Exit calls so all necessary labels
  495. are generated. [Kit] }
  496. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  497. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  498. { restore the control flow labels }
  499. current_procinfo.CurrExitLabel:=oldCurrExitLabel;
  500. if assigned(oldBreakLabel) then
  501. begin
  502. current_procinfo.CurrContinueLabel:=oldContinueLabel;
  503. current_procinfo.CurrBreakLabel:=oldBreakLabel;
  504. end;
  505. { return all used control flow statements }
  506. flowcontrol:=oldflowcontrol+(exceptflowcontrol +
  507. tryflowcontrol - [fc_inflowcontrol]);
  508. end;
  509. initialization
  510. craisenode:=tx64raisenode;
  511. connode:=tx64onnode;
  512. ctryexceptnode:=tx64tryexceptnode;
  513. ctryfinallynode:=tx64tryfinallynode;
  514. end.