globtype.pas 25 KB

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