paramgr.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. {
  2. Copyright (c) 2002 by Florian Klaempfl
  3. Generic calling convention handling
  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. {# Parameter passing manager. Used to manage how
  18. parameters are passed to routines.
  19. }
  20. unit paramgr;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. cclasses,globtype,
  25. cpubase,cgbase,cgutils,
  26. parabase,
  27. aasmtai,aasmdata,
  28. symconst,symtype,symsym,symdef;
  29. type
  30. {# This class defines some methods to take care of routine
  31. parameters. It should be overridden for each new processor
  32. }
  33. { tparamanager }
  34. tparamanager = class
  35. { true if the location in paraloc can be reused as localloc }
  36. function param_use_paraloc(const cgpara:tcgpara):boolean;virtual;
  37. { Returns true if the return value is actually a parameter pointer }
  38. function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;virtual;
  39. function push_high_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  40. function keep_para_array_range(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  41. { Returns true if a parameter is too large to copy and only
  42. the address is pushed
  43. }
  44. function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;abstract;
  45. { returns true if a parameter must be handled via copy-out (construct
  46. a reference, copy the parameter's value there in case of copy-in/out, pass the reference)
  47. }
  48. function push_copyout_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  49. { return the size of a push }
  50. function push_size(varspez:tvarspez;def : tdef;calloption : tproccalloption) : longint;virtual;
  51. {# Returns a structure giving the information on
  52. the storage of the parameter (which must be
  53. an integer parameter). This is only used when calling
  54. internal routines directly, where all parameters must
  55. be 4-byte values.
  56. In case the location is a register, this register is allocated.
  57. Call freeintparaloc() after the call to free the locations again.
  58. Default implementation: don't do anything at all (in case you don't
  59. use register parameter passing)
  60. @param(list Current assembler list)
  61. @param(nr Parameter number of routine, starting from 1)
  62. }
  63. function get_para_align(calloption : tproccalloption):byte;virtual;
  64. function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;virtual;
  65. function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;virtual;
  66. function get_volatile_registers_flags(calloption : tproccalloption):tcpuregisterset;virtual;
  67. function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;virtual;
  68. procedure getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);virtual;
  69. {# allocate an individual pcgparalocation that's part of a tcgpara
  70. @param(list Current assembler list)
  71. @param(loc Parameter location element)
  72. }
  73. procedure allocparaloc(list: TAsmList; const paraloc: pcgparalocation);
  74. {# allocate a parameter location created with create_paraloc_info
  75. @param(list Current assembler list)
  76. @param(loc Parameter location)
  77. }
  78. procedure alloccgpara(list: TAsmList; const cgpara: TCGPara); virtual;
  79. {# free a parameter location allocated with alloccgpara
  80. @param(list Current assembler list)
  81. @param(loc Parameter location)
  82. }
  83. procedure freecgpara(list: TAsmList; const cgpara: TCGPara); virtual;
  84. { This is used to populate the location information on all parameters
  85. for the routine as seen in either the caller or the callee. It returns
  86. the size allocated on the stack
  87. }
  88. function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;virtual;abstract;
  89. { Returns the location of the function result if p had def as
  90. function result instead of its actual result. Used if the compiler
  91. forces the function result to something different than the real
  92. result. }
  93. function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;virtual;abstract;
  94. procedure create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
  95. { This is used to populate the location information on all parameters
  96. for the routine when it is being inlined. It returns
  97. the size allocated on the stack
  98. }
  99. function create_inline_paraloc_info(p : tabstractprocdef):longint;virtual;
  100. { This is used to populate the location information on all parameters
  101. for the routine that are passed as varargs. It returns
  102. the size allocated on the stack (including the normal parameters)
  103. }
  104. function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargsparalist):longint;virtual;abstract;
  105. function is_stack_paraloc(paraloc: pcgparalocation): boolean;virtual;
  106. procedure createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);virtual;
  107. procedure duplicatecgparaloc(const orgparaloc: pcgparalocation; intonewparaloc: pcgparalocation);
  108. procedure duplicateparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;var cgpara:TCGPara);
  109. function parseparaloc(parasym : tparavarsym;const s : string) : boolean;virtual;
  110. function parsefuncretloc(p : tabstractprocdef; const s : string) : boolean;virtual;
  111. { allocate room for parameters on the stack in the entry code? }
  112. function use_fixed_stack: boolean;
  113. { whether stack pointer can be changed in the middle of procedure }
  114. function use_stackalloc: boolean;
  115. strict protected
  116. { common part of get_funcretloc; returns true if retloc is completely
  117. initialized afterwards }
  118. function set_common_funcretloc_info(p : tabstractprocdef; forcetempdef: tdef; out retcgsize: tcgsize; out retloc: tcgpara): boolean;
  119. { common part of ret_in_param; is called by ret_in_param at the
  120. beginning and every tparamanager descendant can decide to call it
  121. itself as well; parameter retinparam is only valid if function
  122. returns true }
  123. function handle_common_ret_in_param(def:tdef;pd:tabstractprocdef;out retinparam:boolean):boolean;
  124. { returns the def to use for a tparalocation part of a cgpara for paradef,
  125. for which the tcgsize is locsize and the integer length is restlen.
  126. fullsize is true if restlen equals the full paradef size }
  127. function get_paraloc_def(paradef: tdef; paracgsize: tcgsize; restlen: aint; fullsize: boolean): tdef;
  128. end;
  129. var
  130. paramanager : tparamanager;
  131. implementation
  132. uses
  133. systems,
  134. cgobj,tgobj,
  135. defutil,verbose;
  136. { true if the location in paraloc can be reused as localloc }
  137. function tparamanager.param_use_paraloc(const cgpara:tcgpara):boolean;
  138. begin
  139. result:=false;
  140. end;
  141. { true if uses a parameter as return value }
  142. function tparamanager.ret_in_param(def:tdef;pd:tabstractprocdef):boolean;
  143. begin
  144. if handle_common_ret_in_param(def,pd,result) then
  145. exit;
  146. ret_in_param:=((def.typ=arraydef) and not(is_dynamic_array(def))) or
  147. (def.typ=recorddef) or
  148. (def.typ=stringdef) or
  149. ((def.typ=procvardef) and not tprocvardef(def).is_addressonly) or
  150. { interfaces are also passed by reference to be compatible with delphi and COM }
  151. ((def.typ=objectdef) and (is_object(def) or is_interface(def) or is_dispinterface(def))) or
  152. (def.typ=variantdef) or
  153. ((def.typ=setdef) and not is_smallset(def));
  154. end;
  155. function tparamanager.push_high_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;
  156. begin
  157. push_high_param:=not(calloption in cdecl_pocalls) and
  158. (
  159. is_open_array(def) or
  160. is_open_string(def) or
  161. is_array_of_const(def)
  162. );
  163. end;
  164. function tparamanager.keep_para_array_range(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean;
  165. begin
  166. result:=push_high_param(varspez,def,calloption);
  167. end;
  168. function tparamanager.push_copyout_param(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean;
  169. begin
  170. push_copyout_param:=false;
  171. end;
  172. { return the size of a push }
  173. function tparamanager.push_size(varspez:tvarspez;def : tdef;calloption : tproccalloption) : longint;
  174. begin
  175. push_size:=-1;
  176. case varspez of
  177. vs_constref,
  178. vs_out,
  179. vs_var :
  180. push_size:=sizeof(pint);
  181. vs_value,
  182. vs_const :
  183. begin
  184. if push_addr_param(varspez,def,calloption) then
  185. push_size:=sizeof(pint)
  186. else
  187. begin
  188. { special array are normally pushed by addr, only for
  189. cdecl array of const it comes here and the pushsize
  190. is unknown }
  191. if is_array_of_const(def) then
  192. push_size:=0
  193. else
  194. push_size:=def.size;
  195. end;
  196. end;
  197. end;
  198. end;
  199. function tparamanager.get_para_align(calloption : tproccalloption):byte;
  200. begin
  201. result:=std_param_align;
  202. end;
  203. function tparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
  204. begin
  205. result:=[];
  206. end;
  207. function tparamanager.get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;
  208. begin
  209. result:=[];
  210. end;
  211. function tparamanager.get_volatile_registers_flags(calloption : tproccalloption):tcpuregisterset;
  212. begin
  213. result:=[];
  214. end;
  215. function tparamanager.get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;
  216. begin
  217. result:=[];
  218. end;
  219. {$if first_mm_imreg = 0}
  220. {$WARN 4044 OFF} { Comparison might be always false ... }
  221. {$endif}
  222. procedure tparamanager.allocparaloc(list: TAsmList; const paraloc: pcgparalocation);
  223. begin
  224. case paraloc^.loc of
  225. LOC_REGISTER,
  226. LOC_CREGISTER:
  227. begin
  228. if getsupreg(paraloc^.register)<first_int_imreg then
  229. begin
  230. cg.getcpuregister(list,paraloc^.register);
  231. {$ifdef cpu16bitalu}
  232. if paraloc^.Size in [OS_32, OS_S32] then
  233. cg.getcpuregister(list,GetNextReg(paraloc^.register));
  234. {$endif cpu16bitalu}
  235. end;
  236. end;
  237. {$ifndef x86}
  238. { don't allocate ST(x), they're not handled by the register allocator }
  239. LOC_FPUREGISTER,
  240. LOC_CFPUREGISTER:
  241. begin
  242. if getsupreg(paraloc^.register)<first_fpu_imreg then
  243. cg.getcpuregister(list,paraloc^.register);
  244. end;
  245. {$endif not x86}
  246. LOC_MMREGISTER,
  247. LOC_CMMREGISTER :
  248. begin
  249. if getsupreg(paraloc^.register)<first_mm_imreg then
  250. cg.getcpuregister(list,paraloc^.register);
  251. end;
  252. end;
  253. end;
  254. procedure tparamanager.alloccgpara(list: TAsmList; const cgpara: TCGPara);
  255. var
  256. paraloc : pcgparalocation;
  257. begin
  258. paraloc:=cgpara.location;
  259. while assigned(paraloc) do
  260. begin
  261. allocparaloc(list,paraloc);
  262. paraloc:=paraloc^.next;
  263. end;
  264. end;
  265. procedure tparamanager.freecgpara(list: TAsmList; const cgpara: TCGPara);
  266. var
  267. paraloc : Pcgparalocation;
  268. href : treference;
  269. begin
  270. paraloc:=cgpara.location;
  271. while assigned(paraloc) do
  272. begin
  273. case paraloc^.loc of
  274. LOC_VOID:
  275. ;
  276. LOC_REGISTER,
  277. LOC_CREGISTER:
  278. begin
  279. if getsupreg(paraloc^.register)<first_int_imreg then
  280. begin
  281. cg.ungetcpuregister(list,paraloc^.register);
  282. {$ifdef cpu16bitalu}
  283. if paraloc^.Size in [OS_32, OS_S32] then
  284. cg.ungetcpuregister(list,GetNextReg(paraloc^.register));
  285. {$endif cpu16bitalu}
  286. end;
  287. end;
  288. LOC_FPUREGISTER,
  289. LOC_CFPUREGISTER:
  290. begin
  291. if getsupreg(paraloc^.register)<first_fpu_imreg then
  292. cg.ungetcpuregister(list,paraloc^.register);
  293. end;
  294. LOC_MMREGISTER,
  295. LOC_CMMREGISTER :
  296. begin
  297. if getsupreg(paraloc^.register)<first_mm_imreg then
  298. cg.ungetcpuregister(list,paraloc^.register);
  299. end;
  300. LOC_REFERENCE,
  301. LOC_CREFERENCE :
  302. begin
  303. if use_fixed_stack then
  304. begin
  305. { don't use reference_reset_base, because that will depend on cgobj }
  306. fillchar(href,sizeof(href),0);
  307. href.base:=paraloc^.reference.index;
  308. href.offset:=paraloc^.reference.offset;
  309. tg.ungetiftemp(list,href);
  310. end;
  311. end;
  312. else
  313. internalerror(2004110212);
  314. end;
  315. paraloc:=paraloc^.next;
  316. end;
  317. end;
  318. function tparamanager.is_stack_paraloc(paraloc: pcgparalocation): boolean;
  319. begin
  320. result:=
  321. assigned(paraloc) and
  322. (paraloc^.loc=LOC_REFERENCE) and
  323. (paraloc^.reference.index=NR_STACK_POINTER_REG);
  324. end;
  325. procedure tparamanager.createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);
  326. var
  327. href : treference;
  328. len : aint;
  329. paraloc,
  330. newparaloc : pcgparalocation;
  331. begin
  332. paraloc:=parasym.paraloc[callerside].location;
  333. cgpara.reset;
  334. cgpara.size:=parasym.paraloc[callerside].size;
  335. cgpara.intsize:=parasym.paraloc[callerside].intsize;
  336. cgpara.alignment:=parasym.paraloc[callerside].alignment;
  337. cgpara.def:=parasym.paraloc[callerside].def;
  338. while assigned(paraloc) do
  339. begin
  340. if paraloc^.size=OS_NO then
  341. len:=push_size(parasym.varspez,parasym.vardef,calloption)
  342. else
  343. len:=tcgsize2size[paraloc^.size];
  344. newparaloc:=cgpara.add_location;
  345. newparaloc^.size:=paraloc^.size;
  346. newparaloc^.def:=paraloc^.def;
  347. newparaloc^.shiftval:=paraloc^.shiftval;
  348. { $warning maybe release this optimization for all targets? }
  349. { released for all CPUs:
  350. i386 isn't affected anyways because it uses the stack to push parameters
  351. on arm it reduces executable size of the compiler by 2.1 per cent (FK) }
  352. { Does it fit a register? }
  353. if ((not can_use_final_stack_loc and
  354. use_fixed_stack) or
  355. not is_stack_paraloc(paraloc)) and
  356. (len<=sizeof(pint)) and
  357. (paraloc^.size in [OS_8,OS_16,OS_32,OS_64,OS_128,OS_S8,OS_S16,OS_S32,OS_S64,OS_S128]) then
  358. newparaloc^.loc:=LOC_REGISTER
  359. else
  360. newparaloc^.loc:=paraloc^.loc;
  361. case newparaloc^.loc of
  362. LOC_REGISTER :
  363. newparaloc^.register:=cg.getintregister(list,paraloc^.size);
  364. LOC_FPUREGISTER :
  365. newparaloc^.register:=cg.getfpuregister(list,paraloc^.size);
  366. LOC_MMREGISTER :
  367. newparaloc^.register:=cg.getmmregister(list,paraloc^.size);
  368. LOC_REFERENCE :
  369. begin
  370. if (can_use_final_stack_loc or
  371. not use_fixed_stack) and
  372. is_stack_paraloc(paraloc) then
  373. duplicatecgparaloc(paraloc,newparaloc)
  374. else
  375. begin
  376. if assigned(cgpara.def) then
  377. tg.gethltemp(list,cgpara.def,len,tt_persistent,href)
  378. else
  379. tg.gettemp(list,len,cgpara.alignment,tt_persistent,href);
  380. newparaloc^.reference.index:=href.base;
  381. newparaloc^.reference.offset:=href.offset;
  382. end;
  383. end;
  384. end;
  385. paraloc:=paraloc^.next;
  386. end;
  387. end;
  388. procedure tparamanager.duplicatecgparaloc(const orgparaloc: pcgparalocation; intonewparaloc: pcgparalocation);
  389. begin
  390. move(orgparaloc^,intonewparaloc^,sizeof(intonewparaloc^));
  391. intonewparaloc^.next:=nil;
  392. end;
  393. procedure tparamanager.duplicateparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;var cgpara:TCGPara);
  394. var
  395. paraloc,
  396. newparaloc : pcgparalocation;
  397. begin
  398. cgpara.reset;
  399. cgpara.size:=parasym.paraloc[callerside].size;
  400. cgpara.intsize:=parasym.paraloc[callerside].intsize;
  401. cgpara.alignment:=parasym.paraloc[callerside].alignment;
  402. paraloc:=parasym.paraloc[callerside].location;
  403. while assigned(paraloc) do
  404. begin
  405. newparaloc:=cgpara.add_location;
  406. duplicatecgparaloc(paraloc,newparaloc);
  407. paraloc:=paraloc^.next;
  408. end;
  409. end;
  410. procedure tparamanager.create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
  411. begin
  412. p.funcretloc[side]:=get_funcretloc(p,side,nil);
  413. end;
  414. function tparamanager.create_inline_paraloc_info(p : tabstractprocdef):longint;
  415. begin
  416. { We need to return the size allocated }
  417. p.init_paraloc_info(callbothsides);
  418. result:=p.calleeargareasize;
  419. end;
  420. function tparamanager.parseparaloc(parasym: tparavarsym; const s: string): boolean;
  421. begin
  422. Result:=False;
  423. internalerror(200807235);
  424. end;
  425. function tparamanager.parsefuncretloc(p: tabstractprocdef; const s: string): boolean;
  426. begin
  427. Result:=False;
  428. internalerror(200807236);
  429. end;
  430. function tparamanager.use_fixed_stack: boolean;
  431. begin
  432. {$ifdef i386}
  433. result := target_info.stackalign > 4;
  434. {$else i386}
  435. {$ifdef cputargethasfixedstack}
  436. result := true;
  437. {$else cputargethasfixedstack}
  438. result := false;
  439. {$endif cputargethasfixedstack}
  440. {$endif i386}
  441. end;
  442. { This is a separate function because at least win64 allows stack allocations
  443. despite of fixed stack semantics (actually supporting it requires generating
  444. a compliant stack frame, not yet possible) }
  445. function tparamanager.use_stackalloc: boolean;
  446. begin
  447. result:=not use_fixed_stack;
  448. end;
  449. function tparamanager.set_common_funcretloc_info(p : tabstractprocdef; forcetempdef: tdef; out retcgsize: tcgsize; out retloc: tcgpara): boolean;
  450. var
  451. paraloc : pcgparalocation;
  452. begin
  453. result:=true;
  454. retloc.init;
  455. if not assigned(forcetempdef) then
  456. retloc.def:=p.returndef
  457. else
  458. begin
  459. retloc.def:=forcetempdef;
  460. retloc.temporary:=true;
  461. end;
  462. retloc.alignment:=get_para_align(p.proccalloption);
  463. { void has no location }
  464. if is_void(retloc.def) then
  465. begin
  466. paraloc:=retloc.add_location;
  467. retloc.size:=OS_NO;
  468. retcgsize:=OS_NO;
  469. retloc.intsize:=0;
  470. paraloc^.def:=retloc.def;
  471. paraloc^.size:=OS_NO;
  472. paraloc^.loc:=LOC_VOID;
  473. exit;
  474. end;
  475. { Constructors return self instead of a boolean }
  476. if p.proctypeoption=potype_constructor then
  477. begin
  478. retloc.def:=tdef(p.owner.defowner);
  479. if not (is_implicit_pointer_object_type(retloc.def) or
  480. (retloc.def.typ<>objectdef)) then
  481. retloc.def:=getpointerdef(retloc.def);
  482. end;
  483. retcgsize:=def_cgsize(retloc.def);
  484. retloc.intsize:=retloc.def.size;
  485. retloc.size:=retcgsize;
  486. { Return is passed as var parameter }
  487. if ret_in_param(retloc.def,p) then
  488. begin
  489. retloc.def:=getpointerdef(retloc.def);
  490. paraloc:=retloc.add_location;
  491. paraloc^.loc:=LOC_REFERENCE;
  492. paraloc^.size:=retcgsize;
  493. paraloc^.def:=retloc.def;
  494. exit;
  495. end;
  496. result:=false;
  497. end;
  498. function tparamanager.handle_common_ret_in_param(def: tdef;
  499. pd: tabstractprocdef; out retinparam: boolean): boolean;
  500. begin
  501. { this must be system independent safecall and record constructor result
  502. is always return in param }
  503. if (tf_safecall_exceptions in target_info.flags) and
  504. (pd.proccalloption=pocall_safecall) or
  505. (
  506. (pd.proctypeoption=potype_constructor)and
  507. (
  508. is_record(def) or
  509. (
  510. (def.typ<>objectdef) and
  511. (pd.owner.symtabletype=objectsymtable) and
  512. is_objectpascal_helper(tdef(pd.owner.defowner))
  513. )
  514. )
  515. ) then
  516. begin
  517. retinparam:=true;
  518. exit(true);
  519. end;
  520. if pd.proctypeoption=potype_constructor then
  521. begin
  522. retinparam:=false;
  523. exit(true);
  524. end;
  525. result:=false;
  526. end;
  527. function tparamanager.get_paraloc_def(paradef: tdef; paracgsize: tcgsize; restlen: aint; fullsize: boolean): tdef;
  528. begin
  529. if fullsize then
  530. result:=paradef
  531. { no support for 128 bit ints -> tcgsize2orddef can't handle
  532. OS_(S)128 }
  533. else if not(paracgsize in [OS_NO,OS_128,OS_S128]) then
  534. result:=cgsize_orddef(paracgsize)
  535. else
  536. result:=getarraydef(u8inttype,restlen);
  537. end;
  538. procedure tparamanager.getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);
  539. begin
  540. if (nr<1) or (nr>pd.paras.count) then
  541. InternalError(2013060101);
  542. pd.init_paraloc_info(callerside);
  543. cgpara:=tparavarsym(pd.paras[nr-1]).paraloc[callerside].getcopy;
  544. end;
  545. initialization
  546. ;
  547. finalization
  548. paramanager.free;
  549. end.