globtype.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. Global types
  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 globtype;
  18. {$i fpcdefs.inc}
  19. interface
  20. const
  21. maxidlen = 127;
  22. type
  23. { TCmdStr is used to pass command line parameters to an external program to be
  24. executed from the FPC application. In some circomstances, this can be more
  25. than 255 characters. That's why using Ansi Strings}
  26. TCmdStr = AnsiString;
  27. TPathStr = AnsiString;
  28. {$ifdef symansistr}
  29. TSymStr = AnsiString;
  30. {$else symansistr}
  31. TSymStr = ShortString;
  32. {$endif symansistr}
  33. PSymStr = ^TSymStr;
  34. Int32 = Longint;
  35. { Integer type corresponding to pointer size }
  36. {$ifdef cpu64bitaddr}
  37. PUint = qword;
  38. PInt = int64;
  39. {$endif cpu64bitaddr}
  40. {$ifdef cpu32bitaddr}
  41. PUint = cardinal;
  42. PInt = longint;
  43. {$endif cpu32bitaddr}
  44. {$ifdef cpu16bitaddr}
  45. PUint = word;
  46. PInt = Smallint;
  47. {$endif cpu16bitaddr}
  48. { Natural integer register type and size for the target machine }
  49. {$ifdef cpu64bitalu}
  50. AWord = qword;
  51. AInt = Int64;
  52. Const
  53. AIntBits = 64;
  54. {$endif cpu64bitalu}
  55. {$ifdef cpu32bitalu}
  56. AWord = longword;
  57. AInt = longint;
  58. Const
  59. AIntBits = 32;
  60. {$endif cpu32bitalu}
  61. {$ifdef cpu16bitalu}
  62. AWord = Word;
  63. AInt = Smallint;
  64. Const
  65. AIntBits = 16;
  66. {$endif cpu16bitalu}
  67. {$ifdef cpu8bitalu}
  68. AWord = Byte;
  69. AInt = Shortint;
  70. Const
  71. AIntBits = 8;
  72. {$endif cpu8bitalu}
  73. Type
  74. PAWord = ^AWord;
  75. PAInt = ^AInt;
  76. { target cpu specific type used to store data sizes }
  77. ASizeInt = PInt;
  78. ASizeUInt = PUInt;
  79. { type used for handling constants etc. in the code generator }
  80. TCGInt = Int64;
  81. { This must be an ordinal type with the same size as a pointer
  82. Note: Must be unsigned! Otherwise, ugly code like
  83. pointer(-1) will result in a pointer with the value
  84. $fffffffffffffff on a 32bit machine if the compiler uses
  85. int64 constants internally (JM) }
  86. TConstPtrUInt = AWord;
  87. { Use a variant record to be sure that the array if aligned correctly }
  88. tdoublerec=record
  89. case byte of
  90. 0 : (bytes:array[0..7] of byte);
  91. 1 : (value:double);
  92. end;
  93. textendedrec=record
  94. case byte of
  95. 0 : (bytes:array[0..9] of byte);
  96. 1 : (value:extended);
  97. end;
  98. pconstset = ^tconstset;
  99. tconstset = set of 0..255;
  100. { Switches which can be changed locally }
  101. tlocalswitch = (cs_localnone,
  102. { codegen }
  103. cs_check_overflow,cs_check_range,cs_check_object,
  104. cs_check_io,cs_check_stack,
  105. cs_checkpointer,cs_check_ordinal_size,
  106. cs_generate_stackframes,cs_do_assertion,cs_generate_rtti,
  107. cs_full_boolean_eval,cs_typed_const_writable,cs_allow_enum_calc,
  108. cs_do_inline,cs_fpu_fwait,cs_ieee_errors,
  109. cs_check_low_addr_load,
  110. { mmx }
  111. cs_mmx,cs_mmx_saturation,
  112. { parser }
  113. cs_typed_addresses,cs_strict_var_strings,cs_refcountedstrings,
  114. cs_bitpacking,cs_varpropsetter,cs_scopedenums,cs_pointermath,
  115. { macpas specific}
  116. cs_external_var, cs_externally_visible,
  117. { jvm specific }
  118. cs_check_var_copyout,
  119. cs_zerobasedstrings
  120. );
  121. tlocalswitches = set of tlocalswitch;
  122. { Switches which can be changed only at the beginning of a new module }
  123. tmoduleswitch = (cs_modulenone,
  124. { parser }
  125. cs_fp_emulation,cs_extsyntax,cs_openstring,
  126. { support }
  127. cs_support_goto,cs_support_macro,
  128. cs_support_c_operators,
  129. { generation }
  130. cs_profile,cs_debuginfo,cs_compilesystem,
  131. cs_lineinfo,cs_implicit_exceptions,cs_explicit_codepage,
  132. { linking }
  133. cs_create_smart,cs_create_dynamic,cs_create_pic,
  134. { browser switches are back }
  135. cs_browser,cs_local_browser,
  136. { target specific }
  137. cs_executable_stack
  138. );
  139. tmoduleswitches = set of tmoduleswitch;
  140. { Switches which can be changed only for a whole program/compilation,
  141. mostly set with commandline }
  142. tglobalswitch = (cs_globalnone,
  143. { parameter switches }
  144. cs_check_unit_name,cs_constructor_name,cs_support_exceptions,
  145. cs_support_c_objectivepas,
  146. { units }
  147. cs_load_objpas_unit,
  148. cs_load_gpc_unit,
  149. cs_load_fpcylix_unit,
  150. cs_support_vectors,
  151. { debuginfo }
  152. cs_use_heaptrc,cs_use_lineinfo,
  153. cs_gdb_valgrind,cs_no_regalloc,cs_stabs_preservecase,
  154. { assembling }
  155. cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
  156. cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
  157. { linking }
  158. cs_link_nolink,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
  159. cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
  160. cs_link_opt_used_sections,cs_link_separate_dbg_file,
  161. cs_link_map,cs_link_pthread,cs_link_no_default_lib_order,
  162. cs_link_native
  163. );
  164. tglobalswitches = set of tglobalswitch;
  165. { global switches specific to debug information }
  166. tdebugswitch = (ds_none,
  167. { enable set support in dwarf debug info, breaks gdb versions }
  168. { without support for that tag (they refuse to parse the rest }
  169. { of the debug information) }
  170. ds_dwarf_sets,
  171. { use absolute paths for include files in stabs. Pro: gdb }
  172. { always knows full path to file. Con: doesn't work anymore }
  173. { if the include file is moved (otherwise, things still work }
  174. { if your source hierarchy is the same, but has a different }
  175. { base path) }
  176. ds_stabs_abs_include_files,
  177. { prefix method names by "classname__" in DWARF (like is done }
  178. { for Stabs); not enabled by default, because otherwise once }
  179. { support for calling methods has been added to gdb, you'd }
  180. { always have to type classinstance.classname__methodname() }
  181. ds_dwarf_method_class_prefix
  182. );
  183. tdebugswitches = set of tdebugswitch;
  184. { global target-specific switches }
  185. ttargetswitch = (ts_none,
  186. { generate code that results in smaller TOCs than normal (AIX) }
  187. ts_small_toc,
  188. { for the JVM target: generate integer array initializations via string
  189. constants in order to reduce the generated code size (Java routines
  190. are limited to 64kb of bytecode) }
  191. ts_compact_int_array_init,
  192. { for the JVM target: intialize enum fields in constructors with the
  193. enum class instance corresponding to ordinal value 0 (not done by
  194. default because this initialization can only be performed after the
  195. inherited constructors have run, and if they call a virtual method
  196. of the current class, then this virtual method may already have
  197. initialized that field with another value and the constructor
  198. initialization will result in data loss }
  199. ts_jvm_enum_field_init,
  200. { when automatically generating getters/setters for properties, use
  201. these strings as prefixes for the generated getters/setter names }
  202. ts_auto_getter_prefix,
  203. ts_auto_setter_predix,
  204. ts_thumb_interworking
  205. );
  206. ttargetswitches = set of ttargetswitch;
  207. { adding a new entry here requires also adding the appropriate define in
  208. systemh.inc (FK)
  209. }
  210. tfeature = (
  211. f_heap,f_init_final,f_rtti,f_classes,f_exceptions,f_exitcode,
  212. f_ansistrings,f_widestrings,f_textio,f_consoleio,f_fileio,
  213. f_random,f_variants,f_objects,f_dynarrays,f_threading,f_commandargs,
  214. f_processes,f_stackcheck,f_dynlibs,f_softfpu,f_objectivec1,f_resources
  215. );
  216. tfeatures = set of tfeature;
  217. type
  218. { optimizer }
  219. toptimizerswitch = (cs_opt_none,
  220. cs_opt_level1,cs_opt_level2,cs_opt_level3,
  221. cs_opt_regvar,cs_opt_uncertain,cs_opt_size,cs_opt_stackframe,
  222. cs_opt_peephole,cs_opt_asmcse,cs_opt_loopunroll,cs_opt_tailrecursion,cs_opt_nodecse,
  223. cs_opt_nodedfa,cs_opt_loopstrength,cs_opt_scheduler,cs_opt_autoinline,cs_useebp,
  224. cs_opt_reorder_fields,cs_opt_fastmath,
  225. { Allow removing expressions whose result is not used, even when this
  226. can change program behaviour (range check errors disappear,
  227. access violations due to invalid pointer derefences disappear, ...).
  228. Note: it does not (and must not) remove expressions that have
  229. explicit side-effects, only implicit side-effects (like the ones
  230. mentioned before) can disappear.
  231. }
  232. cs_opt_dead_values,
  233. { compiler checks for empty procedures/methods and removes calls to them if possible }
  234. cs_opt_remove_emtpy_proc
  235. );
  236. toptimizerswitches = set of toptimizerswitch;
  237. { whole program optimizer }
  238. twpoptimizerswitch = (
  239. cs_wpo_devirtualize_calls,cs_wpo_optimize_vmts,
  240. cs_wpo_symbol_liveness
  241. );
  242. twpoptimizerswitches = set of twpoptimizerswitch;
  243. type
  244. { Used by ARM / AVR to differentiate between specific microcontrollers }
  245. tcontrollerdatatype = record
  246. controllertypestr, controllerunitstr: string[20];
  247. flashbase, flashsize, srambase, sramsize, eeprombase, eepromsize: dword;
  248. end;
  249. ttargetswitchinfo = record
  250. name: string[22];
  251. { target switch can have an arbitratry value, not only on/off }
  252. hasvalue: boolean;
  253. { target switch can be used only globally }
  254. isglobal: boolean;
  255. end;
  256. const
  257. OptimizerSwitchStr : array[toptimizerswitch] of string[16] = ('',
  258. 'LEVEL1','LEVEL2','LEVEL3',
  259. 'REGVAR','UNCERTAIN','SIZE','STACKFRAME',
  260. 'PEEPHOLE','ASMCSE','LOOPUNROLL','TAILREC','CSE',
  261. 'DFA','STRENGTH','SCHEDULE','AUTOINLINE','USEEBP',
  262. 'ORDERFIELDS','FASTMATH','DEADVALUES','REMOVEEMPTYPROCS'
  263. );
  264. WPOptimizerSwitchStr : array [twpoptimizerswitch] of string[14] = (
  265. 'DEVIRTCALLS','OPTVMTS','SYMBOLLIVENESS'
  266. );
  267. DebugSwitchStr : array[tdebugswitch] of string[22] = ('',
  268. 'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
  269. TargetSwitchStr : array[ttargetswitch] of ttargetswitchinfo = (
  270. (name: ''; hasvalue: false; isglobal: true ),
  271. (name: 'SMALLTOC'; hasvalue: false; isglobal: true ),
  272. (name: 'COMPACTINTARRAYINIT'; hasvalue: false; isglobal: true ),
  273. (name: 'ENUMFIELDINIT'; hasvalue: false; isglobal: true ),
  274. (name: 'AUTOGETTERPREFIX'; hasvalue: true ; isglobal: false),
  275. (name: 'AUTOSETTERPREFIX'; hasvalue: true ; isglobal: false),
  276. (name: 'THUMBINTERWORKING'; hasvalue: false; isglobal: true )
  277. );
  278. { switches being applied to all CPUs at the given level }
  279. genericlevel1optimizerswitches = [cs_opt_level1];
  280. genericlevel2optimizerswitches = [cs_opt_level2,cs_opt_remove_emtpy_proc];
  281. genericlevel3optimizerswitches = [cs_opt_level3];
  282. genericlevel4optimizerswitches = [cs_opt_reorder_fields,cs_opt_dead_values,cs_opt_fastmath];
  283. { whole program optimizations whose information generation requires
  284. information from all loaded units
  285. }
  286. WPOptimizationsNeedingAllUnitInfo = [cs_wpo_devirtualize_calls,cs_wpo_optimize_vmts];
  287. featurestr : array[tfeature] of string[12] = (
  288. 'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',
  289. 'ANSISTRINGS','WIDESTRINGS','TEXTIO','CONSOLEIO','FILEIO',
  290. 'RANDOM','VARIANTS','OBJECTS','DYNARRAYS','THREADING','COMMANDARGS',
  291. 'PROCESSES','STACKCHECK','DYNLIBS','SOFTFPU','OBJECTIVEC1','RESOURCES'
  292. );
  293. type
  294. { Switches which can be changed by a mode (fpc,tp7,delphi) }
  295. tmodeswitch = (m_none,
  296. { generic }
  297. m_fpc,m_objfpc,m_delphi,m_tp7,m_mac,m_iso,
  298. {$ifdef fpc_mode}m_gpc,{$endif}
  299. { more specific }
  300. m_class, { delphi class model }
  301. m_objpas, { load objpas unit }
  302. m_result, { result in functions }
  303. m_string_pchar, { pchar 2 string conversion }
  304. m_cvar_support, { cvar variable directive }
  305. m_nested_comment, { nested comments }
  306. m_tp_procvar, { tp style procvars (no @ needed) }
  307. m_mac_procvar, { macpas style procvars }
  308. m_repeat_forward, { repeating forward declarations is needed }
  309. m_pointer_2_procedure, { allows the assignement of pointers to
  310. procedure variables }
  311. m_autoderef, { does auto dereferencing of struct. vars }
  312. m_initfinal, { initialization/finalization for units }
  313. m_default_ansistring, { ansistring turned on by default }
  314. m_out, { support the calling convention OUT }
  315. m_default_para, { support default parameters }
  316. m_hintdirective, { support hint directives }
  317. m_duplicate_names, { allow locals/paras to have duplicate names of globals }
  318. m_property, { allow properties }
  319. m_default_inline, { allow inline proc directive }
  320. m_except, { allow exception-related keywords }
  321. m_objectivec1, { support interfacing with Objective-C (1.0) }
  322. m_objectivec2, { support interfacing with Objective-C (2.0) }
  323. m_nested_procvars, { support nested procedural variables }
  324. m_non_local_goto, { support non local gotos (like iso pascal) }
  325. m_advanced_records, { advanced record syntax with visibility sections, methods and properties }
  326. m_isolike_unary_minus, { unary minus like in iso pascal: same precedence level as binary minus/plus }
  327. m_systemcodepage, { use system codepage as compiler codepage by default, emit ansistrings with system codepage }
  328. m_final_fields, { allows declaring fields as "final", which means they must be initialised
  329. in the (class) constructor and are constant from then on (same as final
  330. fields in Java) }
  331. m_default_unicodestring { makes the default string type in $h+ mode unicodestring rather than
  332. ansistring; similarly, char becomes unicodechar rather than ansichar }
  333. );
  334. tmodeswitches = set of tmodeswitch;
  335. const
  336. alllanguagemodes = [m_fpc,m_objfpc,m_delphi,m_tp7,m_mac,m_iso];
  337. type
  338. { Application types (platform specific) }
  339. tapptype = (
  340. app_none,
  341. app_native, { native for Windows and NativeNT targets }
  342. app_gui, { graphic user-interface application }
  343. app_cui, { console application }
  344. app_fs, { full-screen type application (OS/2 and EMX only) }
  345. app_tool, { tool application, (MPW tool for MacOS, MacOS only) }
  346. app_arm7, { for Nintendo DS target }
  347. app_arm9, { for Nintendo DS target }
  348. app_bundle { dynamically loadable bundle, Darwin only }
  349. );
  350. { interface types }
  351. tinterfacetypes = (
  352. it_interfacecom,
  353. it_interfacecorba,
  354. it_interfacejava
  355. );
  356. { currently parsed block type }
  357. tblock_type = (
  358. bt_none, { not assigned }
  359. bt_general, { default }
  360. bt_type, { type section }
  361. bt_const, { const section }
  362. bt_const_type, { const part of type. e.g.: ": Integer = 1" }
  363. bt_var, { variable declaration }
  364. bt_var_type, { type of variable }
  365. bt_except, { except section }
  366. bt_body { procedure body }
  367. );
  368. { Temp types }
  369. ttemptype = (tt_none,
  370. { free temp location, can be reused for something else }
  371. tt_free,
  372. { temp location that will be freed when ttgobj.UnGetTemp/
  373. ttgobj.UnGetIfTemp is called on it }
  374. tt_normal,
  375. { temp location that will not be freed; if it has to be
  376. freed, first ttgobj.changetemptype() it to tt_normal,
  377. or call ttgobj.UnGetLocal() instead (for local variables,
  378. since they are also persistent temps) }
  379. tt_persistent,
  380. { temp location that can never be reused anymore, even
  381. after it has been freed }
  382. tt_noreuse,
  383. { freed version of the above }
  384. tt_freenoreuse,
  385. { temp location that has been allocated by the register
  386. allocator and that can be reallocated only by the
  387. register allocator }
  388. tt_regallocator,
  389. { freed version of the above }
  390. tt_freeregallocator);
  391. ttemptypeset = set of ttemptype;
  392. { calling convention for tprocdef and tprocvardef }
  393. tproccalloption=(pocall_none,
  394. { procedure uses C styled calling }
  395. pocall_cdecl,
  396. { C++ calling conventions }
  397. pocall_cppdecl,
  398. { Far16 for OS/2 }
  399. pocall_far16,
  400. { Old style FPC default calling }
  401. pocall_oldfpccall,
  402. { Procedure has compiler magic}
  403. pocall_internproc,
  404. { procedure is a system call, applies e.g. to MorphOS and PalmOS }
  405. pocall_syscall,
  406. { pascal standard left to right }
  407. pocall_pascal,
  408. { procedure uses register (fastcall) calling }
  409. pocall_register,
  410. { safe call calling conventions }
  411. pocall_safecall,
  412. { procedure uses stdcall call }
  413. pocall_stdcall,
  414. { Special calling convention for cpus without a floating point
  415. unit. Floating point numbers are passed in integer registers
  416. instead of floating point registers. Depending on the other
  417. available calling conventions available for the cpu
  418. this replaces either pocall_fastcall or pocall_stdcall.
  419. }
  420. pocall_softfloat,
  421. { Metrowerks Pascal. Special case on Mac OS (X): passes all }
  422. { constant records by reference. }
  423. pocall_mwpascal,
  424. { Special interrupt handler for embedded systems }
  425. pocall_interrupt
  426. );
  427. tproccalloptions = set of tproccalloption;
  428. const
  429. proccalloptionStr : array[tproccalloption] of string[14]=('',
  430. 'CDecl',
  431. 'CPPDecl',
  432. 'Far16',
  433. 'OldFPCCall',
  434. 'InternProc',
  435. 'SysCall',
  436. 'Pascal',
  437. 'Register',
  438. 'SafeCall',
  439. 'StdCall',
  440. 'SoftFloat',
  441. 'MWPascal',
  442. 'Interrupt'
  443. );
  444. { Default calling convention }
  445. {$if defined(i8086)}
  446. pocall_default = pocall_pascal;
  447. {$elseif defined(i386) or defined(x86_64)}
  448. pocall_default = pocall_register;
  449. {$else}
  450. pocall_default = pocall_stdcall;
  451. {$endif}
  452. cstylearrayofconst = [pocall_cdecl,pocall_cppdecl,pocall_mwpascal];
  453. modeswitchstr : array[tmodeswitch] of string[18] = ('',
  454. '','','','','','',
  455. {$ifdef fpc_mode}'',{$endif}
  456. { more specific }
  457. 'CLASS',
  458. 'OBJPAS',
  459. 'RESULT',
  460. 'PCHARTOSTRING',
  461. 'CVAR',
  462. 'NESTEDCOMMENTS',
  463. 'CLASSICPROCVARS',
  464. 'MACPROCVARS',
  465. 'REPEATFORWARD',
  466. 'POINTERTOPROCVAR',
  467. 'AUTODEREF',
  468. 'INITFINAL',
  469. 'ANSISTRINGS',
  470. 'OUT',
  471. 'DEFAULTPARAMETERS',
  472. 'HINTDIRECTIVE',
  473. 'DUPLICATELOCALS',
  474. 'PROPERTIES',
  475. 'ALLOWINLINE',
  476. 'EXCEPTIONS',
  477. 'OBJECTIVEC1',
  478. 'OBJECTIVEC2',
  479. 'NESTEDPROCVARS',
  480. 'NONLOCALGOTO',
  481. 'ADVANCEDRECORDS',
  482. 'ISOUNARYMINUS',
  483. 'SYSTEMCODEPAGE',
  484. 'FINALFIELDS',
  485. 'UNICODESTRINGS');
  486. type
  487. tprocinfoflag=(
  488. { procedure has at least one assembler block }
  489. pi_has_assembler_block,
  490. { procedure does a call }
  491. pi_do_call,
  492. { procedure has a try statement = no register optimization }
  493. pi_uses_exceptions,
  494. { procedure is declared as @var(assembler), don't optimize}
  495. pi_is_assembler,
  496. { procedure contains data which needs to be finalized }
  497. pi_needs_implicit_finally,
  498. { procedure has the implicit try..finally generated }
  499. pi_has_implicit_finally,
  500. { procedure uses fpu}
  501. pi_uses_fpu,
  502. { procedure uses GOT for PIC code }
  503. pi_needs_got,
  504. { references var/proc/type/const in static symtable,
  505. i.e. not allowed for inlining from other units }
  506. pi_uses_static_symtable,
  507. { set if the procedure has to push parameters onto the stack }
  508. pi_has_stackparameter,
  509. { set if the procedure has at least one label }
  510. pi_has_label,
  511. { calls itself recursive }
  512. pi_is_recursive,
  513. { stack frame optimization not possible (only on x86 probably) }
  514. pi_needs_stackframe,
  515. { set if the procedure has at least one register saved on the stack }
  516. pi_has_saved_regs,
  517. { dfa was generated for this proc }
  518. pi_dfaavailable,
  519. { subroutine contains interprocedural used labels }
  520. pi_has_interproclabel,
  521. { subroutine has unwind info (win64) }
  522. pi_has_unwind_info,
  523. { subroutine contains interprocedural gotos }
  524. pi_has_global_goto,
  525. { subroutine contains inherited call }
  526. pi_has_inherited,
  527. { subroutine has nested exit }
  528. pi_has_nested_exit
  529. );
  530. tprocinfoflags=set of tprocinfoflag;
  531. type
  532. { float types -- warning, this enum/order is used internally by the RTL
  533. as well in rtl/inc/real2str.inc }
  534. tfloattype = (
  535. s32real,s64real,s80real,sc80real { the C "long double" type on x86 },
  536. s64comp,s64currency,s128real
  537. );
  538. type
  539. { register allocator live range extension direction }
  540. TRADirection = (rad_forward, rad_backwards, rad_backwards_reinit);
  541. type
  542. TIDString = string[maxidlen];
  543. tnormalset = set of byte; { 256 elements set }
  544. pnormalset = ^tnormalset;
  545. pboolean = ^boolean;
  546. pdouble = ^double;
  547. pbyte = ^byte;
  548. pword = ^word;
  549. plongint = ^longint;
  550. plongintarray = plongint;
  551. pfileposinfo = ^tfileposinfo;
  552. tfileposinfo = record
  553. { if types of column or fileindex are changed, modify tcompilerppufile.putposinfo }
  554. line : longint;
  555. column : word;
  556. fileindex : word;
  557. moduleindex : word;
  558. end;
  559. {$ifndef xFPC}
  560. type
  561. pguid = ^tguid;
  562. tguid = packed record
  563. D1: LongWord;
  564. D2: Word;
  565. D3: Word;
  566. D4: array[0..7] of Byte;
  567. end;
  568. {$endif}
  569. tstringencoding = Word;
  570. tcodepagestring = string[20];
  571. const
  572. { link options }
  573. link_none = $0;
  574. link_always = $1;
  575. link_static = $2;
  576. link_smart = $4;
  577. link_shared = $8;
  578. type
  579. { a message state }
  580. tmsgstate = (
  581. ms_on := 1,
  582. ms_off := 2,
  583. ms_error := 3,
  584. ms_on_global := $11, // turn on output
  585. ms_off_global := $22, // turn off output
  586. ms_error_global := $33 // cast to error
  587. );
  588. const
  589. { Mask for current value of message state }
  590. ms_local_mask = $0f;
  591. { Mask for global value of message state
  592. that needs to be restored when changing units }
  593. ms_global_mask = $f0;
  594. { Shift used to convert global to local message state }
  595. ms_shift = 4;
  596. type
  597. pmessagestaterecord = ^tmessagestaterecord;
  598. tmessagestaterecord = record
  599. next : pmessagestaterecord;
  600. value : longint;
  601. state : tmsgstate;
  602. end;
  603. { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
  604. const
  605. ExecuteProcess = 'Do not use' deprecated 'Use cfileutil.RequotedExecuteProcess instead, ExecuteProcess cannot deal with single quotes as used by Unix command lines';
  606. implementation
  607. end.