nx64flw.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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. end;
  182. end;
  183. result:=n;
  184. end;
  185. function tx64tryfinallynode.simplify(forinline: boolean): tnode;
  186. begin
  187. result:=inherited simplify(forinline);
  188. if (target_info.system<>system_x86_64_win64) then
  189. exit;
  190. if (result=nil) then
  191. begin
  192. { actually, this is not really the right place to do a node transformation like this }
  193. if not(assigned(finalizepi.code)) then
  194. begin
  195. finalizepi.code:=right;
  196. foreachnodestatic(right,@copy_parasize,finalizepi);
  197. right:=ccallnode.create(nil,tprocsym(finalizepi.procdef.procsym),nil,nil,[],nil);
  198. firstpass(right);
  199. { For implicit frames, no actual code is available at this time,
  200. it is added later in assembler form. So store the nested procinfo
  201. for later use. }
  202. if implicitframe then
  203. begin
  204. current_procinfo.finalize_procinfo:=finalizepi;
  205. end;
  206. end;
  207. end;
  208. end;
  209. procedure emit_nop;
  210. var
  211. dummy: TAsmLabel;
  212. begin
  213. { To avoid optimizing away the whole thing, prepend a jumplabel with increased refcount }
  214. current_asmdata.getjumplabel(dummy);
  215. dummy.increfs;
  216. cg.a_label(current_asmdata.CurrAsmList,dummy);
  217. current_asmdata.CurrAsmList.concat(Taicpu.op_none(A_NOP,S_NO));
  218. end;
  219. procedure tx64tryfinallynode.pass_generate_code;
  220. var
  221. trylabel,
  222. endtrylabel,
  223. finallylabel,
  224. endfinallylabel,
  225. templabel,
  226. oldexitlabel: tasmlabel;
  227. oldflowcontrol: tflowcontrol;
  228. catch_frame: boolean;
  229. begin
  230. if (target_info.system<>system_x86_64_win64) then
  231. begin
  232. inherited pass_generate_code;
  233. exit;
  234. end;
  235. location_reset(location,LOC_VOID,OS_NO);
  236. { Do not generate a frame that catches exceptions if the only action
  237. would be reraising it. Doing so is extremely inefficient with SEH
  238. (in contrast with setjmp/longjmp exception handling) }
  239. catch_frame:=implicitframe and
  240. (current_procinfo.procdef.proccalloption=pocall_safecall);
  241. oldflowcontrol:=flowcontrol;
  242. flowcontrol:=[fc_inflowcontrol];
  243. templabel:=nil;
  244. current_asmdata.getjumplabel(trylabel);
  245. current_asmdata.getjumplabel(endtrylabel);
  246. current_asmdata.getjumplabel(finallylabel);
  247. current_asmdata.getjumplabel(endfinallylabel);
  248. oldexitlabel:=current_procinfo.CurrExitLabel;
  249. if implicitframe then
  250. current_procinfo.CurrExitLabel:=finallylabel;
  251. { Start of scope }
  252. { Padding with NOP is necessary here because exceptions in called
  253. procedures are seen at the next instruction, while CPU/OS exceptions
  254. like AV are seen at the current instruction.
  255. So in the following code
  256. raise_some_exception; //(a)
  257. try
  258. pchar(nil)^:='0'; //(b)
  259. ...
  260. without NOP, exceptions (a) and (b) will be seen at the same address
  261. and fall into the same scope. However they should be seen in different scopes.
  262. }
  263. emit_nop;
  264. cg.a_label(current_asmdata.CurrAsmList,trylabel);
  265. { try code }
  266. if assigned(left) then
  267. begin
  268. { fc_unwind_xx tells exit/continue/break statements to emit special
  269. unwind code instead of just JMP }
  270. if not implicitframe then
  271. flowcontrol:=flowcontrol+[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
  272. secondpass(left);
  273. flowcontrol:=flowcontrol-[fc_catching_exceptions,fc_unwind_exit,fc_unwind_loop];
  274. if codegenerror then
  275. exit;
  276. end;
  277. { finallylabel is only used in implicit frames as an exit point from nested try..finally
  278. statements, if any. To prevent finalizer from being executed twice, it must come before
  279. endtrylabel (bug #34772) }
  280. if catch_frame then
  281. begin
  282. current_asmdata.getjumplabel(templabel);
  283. cg.a_label(current_asmdata.CurrAsmList, finallylabel);
  284. { jump over exception handler }
  285. cg.a_jmp_always(current_asmdata.CurrAsmList,templabel);
  286. { Handle the except block first, so endtrylabel serves both
  287. as end of scope and as unwind target. This way it is possible to
  288. encode everything into a single scope record. }
  289. cg.a_label(current_asmdata.CurrAsmList,endtrylabel);
  290. if (current_procinfo.procdef.proccalloption=pocall_safecall) then
  291. begin
  292. handle_safecall_exception;
  293. cg.a_jmp_always(current_asmdata.CurrAsmList,endfinallylabel);
  294. end
  295. else
  296. InternalError(2014031601);
  297. cg.a_label(current_asmdata.CurrAsmList,templabel);
  298. end
  299. else
  300. begin
  301. { same as emit_nop but using finallylabel instead of dummy }
  302. cg.a_label(current_asmdata.CurrAsmList,finallylabel);
  303. finallylabel.increfs;
  304. current_asmdata.CurrAsmList.concat(Taicpu.op_none(A_NOP,S_NO));
  305. cg.a_label(current_asmdata.CurrAsmList,endtrylabel);
  306. end;
  307. { i32913 - if the try..finally block is also inside a try..finally or
  308. try..except block, make a note of any Exit calls so all necessary labels
  309. are generated. [Kit] }
  310. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  311. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  312. flowcontrol:=[fc_inflowcontrol];
  313. { generate finally code as a separate procedure }
  314. if not implicitframe then
  315. tcgprocinfo(current_procinfo).generate_exceptfilter(finalizepi);
  316. { right is a call to finalizer procedure }
  317. secondpass(right);
  318. if codegenerror then
  319. exit;
  320. { normal exit from safecall proc must zero the result register }
  321. if implicitframe and (current_procinfo.procdef.proccalloption=pocall_safecall) then
  322. cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,0,NR_FUNCTION_RESULT_REG);
  323. cg.a_label(current_asmdata.CurrAsmList,endfinallylabel);
  324. { generate the scope record in .xdata }
  325. tcpuprocinfo(current_procinfo).add_finally_scope(trylabel,endtrylabel,
  326. current_asmdata.RefAsmSymbol(finalizepi.procdef.mangledname,AT_FUNCTION),catch_frame);
  327. if implicitframe then
  328. current_procinfo.CurrExitLabel:=oldexitlabel;
  329. flowcontrol:=oldflowcontrol;
  330. end;
  331. { tx64tryexceptnode }
  332. procedure tx64tryexceptnode.pass_generate_code;
  333. var
  334. trylabel,
  335. exceptlabel,oldendexceptlabel,
  336. lastonlabel,
  337. exitexceptlabel,
  338. continueexceptlabel,
  339. breakexceptlabel,
  340. oldCurrExitLabel,
  341. oldContinueLabel,
  342. oldBreakLabel : tasmlabel;
  343. onlabel,
  344. filterlabel: tasmlabel;
  345. oldflowcontrol,tryflowcontrol,
  346. exceptflowcontrol : tflowcontrol;
  347. hnode : tnode;
  348. hlist : tasmlist;
  349. onnodecount : tai_const;
  350. sym : tasmsymbol;
  351. label
  352. errorexit;
  353. begin
  354. if (target_info.system<>system_x86_64_win64) then
  355. begin
  356. inherited pass_generate_code;
  357. exit;
  358. end;
  359. location_reset(location,LOC_VOID,OS_NO);
  360. oldflowcontrol:=flowcontrol;
  361. exceptflowcontrol:=[];
  362. continueexceptlabel:=nil;
  363. breakexceptlabel:=nil;
  364. include(flowcontrol,fc_inflowcontrol);
  365. { this can be called recursivly }
  366. oldBreakLabel:=nil;
  367. oldContinueLabel:=nil;
  368. oldendexceptlabel:=endexceptlabel;
  369. { save the old labels for control flow statements }
  370. oldCurrExitLabel:=current_procinfo.CurrExitLabel;
  371. current_asmdata.getjumplabel(exitexceptlabel);
  372. if assigned(current_procinfo.CurrBreakLabel) then
  373. begin
  374. oldContinueLabel:=current_procinfo.CurrContinueLabel;
  375. oldBreakLabel:=current_procinfo.CurrBreakLabel;
  376. current_asmdata.getjumplabel(breakexceptlabel);
  377. current_asmdata.getjumplabel(continueexceptlabel);
  378. end;
  379. current_asmdata.getjumplabel(exceptlabel);
  380. current_asmdata.getjumplabel(endexceptlabel);
  381. current_asmdata.getjumplabel(lastonlabel);
  382. filterlabel:=nil;
  383. { start of scope }
  384. current_asmdata.getjumplabel(trylabel);
  385. emit_nop;
  386. cg.a_label(current_asmdata.CurrAsmList,trylabel);
  387. { control flow in try block needs no special handling,
  388. just make sure that target labels are outside the scope }
  389. secondpass(left);
  390. tryflowcontrol:=flowcontrol;
  391. if codegenerror then
  392. goto errorexit;
  393. { jump over except handlers }
  394. cg.a_jmp_always(current_asmdata.CurrAsmList,endexceptlabel);
  395. { end of scope }
  396. cg.a_label(current_asmdata.CurrAsmList,exceptlabel);
  397. { set control flow labels for the except block }
  398. { and the on statements }
  399. current_procinfo.CurrExitLabel:=exitexceptlabel;
  400. if assigned(oldBreakLabel) then
  401. begin
  402. current_procinfo.CurrContinueLabel:=continueexceptlabel;
  403. current_procinfo.CurrBreakLabel:=breakexceptlabel;
  404. end;
  405. { i32913 - if the try..finally block is also inside a try..finally or
  406. try..except block, make a note of any Exit calls so all necessary labels
  407. are generated. [Kit] }
  408. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  409. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  410. flowcontrol:=[fc_inflowcontrol];
  411. { on statements }
  412. if assigned(right) then
  413. begin
  414. { emit filter table to a temporary asmlist }
  415. hlist:=TAsmList.Create;
  416. current_asmdata.getaddrlabel(filterlabel);
  417. new_section(hlist,sec_rodata_norel,filterlabel.name,4);
  418. cg.a_label(hlist,filterlabel);
  419. onnodecount:=tai_const.create_32bit(0);
  420. hlist.concat(onnodecount);
  421. hnode:=right;
  422. while assigned(hnode) do
  423. begin
  424. if hnode.nodetype<>onn then
  425. InternalError(2011103101);
  426. current_asmdata.getjumplabel(onlabel);
  427. sym:=current_asmdata.RefAsmSymbol(tonnode(hnode).excepttype.vmt_mangledname,AT_DATA,true);
  428. hlist.concat(tai_const.create_rva_sym(sym));
  429. hlist.concat(tai_const.create_rva_sym(onlabel));
  430. current_module.add_extern_asmsym(sym);
  431. cg.a_label(current_asmdata.CurrAsmList,onlabel);
  432. secondpass(hnode);
  433. inc(onnodecount.value);
  434. hnode:=tonnode(hnode).left;
  435. end;
  436. { add 'else' node to the filter list, too }
  437. if assigned(t1) then
  438. begin
  439. hlist.concat(tai_const.create_32bit(-1));
  440. hlist.concat(tai_const.create_rva_sym(lastonlabel));
  441. inc(onnodecount.value);
  442. end;
  443. { now move filter table to permanent list all at once }
  444. current_procinfo.aktlocaldata.concatlist(hlist);
  445. hlist.free;
  446. end;
  447. cg.a_label(current_asmdata.CurrAsmList,lastonlabel);
  448. if assigned(t1) then
  449. begin
  450. { here we don't have to reset flowcontrol }
  451. { the default and on flowcontrols are handled equal }
  452. secondpass(t1);
  453. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  454. if (flowcontrol*[fc_exit,fc_break,fc_continue]<>[]) then
  455. cg.a_jmp_always(current_asmdata.CurrAsmList,endexceptlabel);
  456. end;
  457. exceptflowcontrol:=flowcontrol;
  458. if fc_exit in exceptflowcontrol then
  459. begin
  460. { do some magic for exit in the try block }
  461. cg.a_label(current_asmdata.CurrAsmList,exitexceptlabel);
  462. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  463. if (fc_unwind_exit in oldflowcontrol) then
  464. cg.g_local_unwind(current_asmdata.CurrAsmList,oldCurrExitLabel)
  465. else
  466. cg.a_jmp_always(current_asmdata.CurrAsmList,oldCurrExitLabel);
  467. end;
  468. if fc_break in exceptflowcontrol then
  469. begin
  470. cg.a_label(current_asmdata.CurrAsmList,breakexceptlabel);
  471. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  472. if (fc_unwind_loop in oldflowcontrol) then
  473. cg.g_local_unwind(current_asmdata.CurrAsmList,oldBreakLabel)
  474. else
  475. cg.a_jmp_always(current_asmdata.CurrAsmList,oldBreakLabel);
  476. end;
  477. if fc_continue in exceptflowcontrol then
  478. begin
  479. cg.a_label(current_asmdata.CurrAsmList,continueexceptlabel);
  480. cg.g_call(current_asmdata.CurrAsmList,'FPC_DONEEXCEPTION');
  481. if (fc_unwind_loop in oldflowcontrol) then
  482. cg.g_local_unwind(current_asmdata.CurrAsmList,oldContinueLabel)
  483. else
  484. cg.a_jmp_always(current_asmdata.CurrAsmList,oldContinueLabel);
  485. end;
  486. emit_nop;
  487. cg.a_label(current_asmdata.CurrAsmList,endexceptlabel);
  488. tcpuprocinfo(current_procinfo).add_except_scope(trylabel,exceptlabel,endexceptlabel,filterlabel);
  489. errorexit:
  490. { restore all saved labels }
  491. endexceptlabel:=oldendexceptlabel;
  492. { i32913 - if the try..finally block is also inside a try..finally or
  493. try..except block, make a note of any Exit calls so all necessary labels
  494. are generated. [Kit] }
  495. if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
  496. oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
  497. { restore the control flow labels }
  498. current_procinfo.CurrExitLabel:=oldCurrExitLabel;
  499. if assigned(oldBreakLabel) then
  500. begin
  501. current_procinfo.CurrContinueLabel:=oldContinueLabel;
  502. current_procinfo.CurrBreakLabel:=oldBreakLabel;
  503. end;
  504. { return all used control flow statements }
  505. flowcontrol:=oldflowcontrol+(exceptflowcontrol +
  506. tryflowcontrol - [fc_inflowcontrol]);
  507. end;
  508. initialization
  509. craisenode:=tx64raisenode;
  510. connode:=tx64onnode;
  511. ctryexceptnode:=tx64tryexceptnode;
  512. ctryfinallynode:=tx64tryfinallynode;
  513. end.