101
73
cs_load_objpas_unit,
104
cs_regalloc,cs_uncertainopts,cs_littlesize,cs_optimize,
105
cs_fastoptimize, cs_slowoptimize,cs_align,
76
cs_regvars,cs_no_regalloc,cs_uncertainopts,cs_littlesize,
77
cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_align,
109
cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_gdb_lineinfo,cs_checkpointer,
81
cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_gdb_lineinfo,
82
cs_checkpointer,cs_gdb_valgrind,
111
84
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
112
cs_asm_regalloc,cs_asm_tempalloc,
85
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
114
87
cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
115
cs_link_strip,cs_link_toc,cs_link_staticflag
88
cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_internal,
89
cs_link_map,cs_link_pthread
117
91
tglobalswitches = set of tglobalswitch;
119
93
{ Switches which can be changed by a mode (fpc,tp7,delphi) }
120
94
tmodeswitch = (m_none,m_all, { needed for keyword }
122
m_fpc,m_objfpc,m_delphi,m_tp,m_tp7,m_gpc,
96
m_fpc,m_objfpc,m_delphi,m_tp7,m_gpc,m_mac,
124
98
m_class, { delphi class model }
125
99
m_objpas, { load objpas unit }
134
108
m_autoderef, { does auto dereferencing of struct. vars }
135
109
m_initfinal, { initialization/finalization for units }
136
110
m_add_pointer, { allow pointer add/sub operations }
137
m_default_ansistring { ansistring turned on by default }
111
m_default_ansistring, { ansistring turned on by default }
112
m_out, { support the calling convention OUT }
113
m_default_para, { support default parameters }
114
m_hintdirective, { support hint directives }
115
m_duplicate_names { allow locals/paras to have duplicate names of globals }
139
117
tmodeswitches = set of tmodeswitch;
119
{ Win32, OS/2 & MacOS application types }
122
app_gui, { graphic user-interface application}
123
app_cui, { console application}
124
app_fs, { full-screen type application (OS/2 and EMX only) }
125
app_tool { tool application, (MPW tool for MacOS, MacOS only)}
146
134
{ currently parsed block type }
147
135
tblock_type = (bt_none,
148
bt_general,bt_type,bt_const,bt_except
151
{ packrecords types }
152
tpackrecords = (packrecord_none,
153
packrecord_1,packrecord_2,packrecord_4,
154
packrecord_8,packrecord_16,packrecord_32,
159
packrecordalignment : array[tpackrecords] of byte=(0,
136
bt_general,bt_type,bt_const,bt_except,bt_body
139
{ calling convention for tprocdef and tprocvardef }
140
tproccalloption=(pocall_none,
141
{ procedure uses C styled calling }
143
{ C++ calling conventions }
145
{ Procedure is used for internal compiler calls }
149
{ Old style FPC default calling }
151
{ Procedure is an assembler macro }
153
{ Procedure has compiler magic}
155
{ procedure is a system call, applies e.g. to MorphOS and PalmOS }
157
{ pascal standard left to right }
159
{ procedure uses register (fastcall) calling }
161
{ safe call calling conventions }
163
{ procedure uses stdcall call }
165
{ Special calling convention for cpus without a floating point
166
unit. Floating point numbers are passed in integer registers
167
instead of floating point registers. Depending on the other
168
available calling conventions available for the cpu
169
this replaces either pocall_fastcall or pocall_stdcall.
173
tproccalloptions = set of tproccalloption;
176
{ procedure uses asm }
178
{ procedure does a call }
180
{ procedure has a try statement = no register optimization }
182
{ procedure is declared as @var(assembler), don't optimize}
184
{ procedure contains data which needs to be finalized }
185
pi_needs_implicit_finally,
186
{ procedure has the implicit try..finally generated }
187
pi_has_implicit_finally,
188
{ procedure uses fpu}
190
{ procedure uses GOT for PIC code }
193
tprocinfoflags=set of tprocinfoflag;
195
{$ifdef ansistring_bits}
196
Tstringbits=(sb_16,sb_32,sb_64);
200
proccalloptionStr : array[tproccalloption] of string[14]=('',
216
{ Default calling convention }
218
pocall_default = pocall_register;
220
pocall_default = pocall_stdcall;
164
224
stringid = string[maxidlen];
198
263
link_shared = $8;
207
269
$Log: globtype.pas,v $
208
Revision 1.1.2.1 2000/08/05 13:22:30 peter
209
* packenum 1 when packenumfixed is defined
211
Revision 1.1 2000/07/13 06:29:51 michael
214
Revision 1.32 2000/06/11 07:00:21 peter
215
* fixed pchar->string conversion for delphi mode
217
Revision 1.31 2000/05/31 06:57:11 florian
218
* first implementation of -Oa switch
220
Revision 1.30 2000/05/16 20:19:05 pierre
221
+ -CR option to enable check for object virtual method
223
Revision 1.29 2000/02/28 17:23:57 daniel
224
* Current work of symtable integration committed. The symtable can be
225
activated by defining 'newst', but doesn't compile yet. Changes in type
226
checking and oop are completed. What is left is to write a new
227
symtablestack and adapt the parser to use it.
229
Revision 1.28 2000/02/09 13:22:53 peter
232
Revision 1.27 2000/02/09 10:35:48 peter
233
* -Xt option to link staticly against c libs
235
Revision 1.26 2000/02/06 17:20:52 peter
236
* -gl switch for auto lineinfo including
238
Revision 1.25 2000/01/07 01:14:27 peter
239
* updated copyright to 2000
241
Revision 1.24 1999/11/12 11:03:50 peter
242
* searchpaths changed to stringqueue object
244
Revision 1.23 1999/11/09 13:00:38 peter
245
* define FPC_DELPHI,FPC_OBJFPC,FPC_TP,FPC_GPC
246
* initial support for ansistring default with modes
248
Revision 1.22 1999/11/06 14:34:21 peter
249
* truncated log to 20 revs
251
Revision 1.21 1999/11/04 10:55:31 peter
252
* TSearchPathString for the string type of the searchpaths, which is
253
ansistring under FPC/Delphi
255
Revision 1.20 1999/10/22 10:39:34 peter
256
* split type reading from pdecl to ptype unit
257
* parameter_dec routine is now used for procedure and procvars
259
Revision 1.19 1999/09/20 16:38:54 peter
260
* cs_create_smart instead of cs_smartlink
261
* -CX is create smartlink
262
* -CD is create dynamic, but does nothing atm.
264
Revision 1.18 1999/09/08 16:05:32 peter
265
* pointer add/sub is now as expected and the same results as inc/dec
267
Revision 1.17 1999/08/13 15:44:58 peter
268
* first things to include lineinfo in the executable
270
Revision 1.16 1999/08/11 17:26:33 peter
271
* tlinker object is now inherited for win32 and dos
272
* postprocessexecutable is now a method of tlinker
274
Revision 1.15 1999/08/04 13:02:42 jonas
275
* all tokens now start with an underscore
278
Revision 1.14 1999/08/01 23:04:48 michael
281
Revision 1.13 1999/07/23 16:05:21 peter
282
* alignment is now saved in the symtable
283
* C alignment added for records
284
* PPU version increased to solve .12 <-> .13 probs
270
Revision 1.56 2004/05/23 15:06:20 peter
271
* implicit_finally flag must be set in pass1
272
* add check whether the implicit frame is generated when expected
274
Revision 1.55 2004/05/23 14:32:17 peter
275
* tprocinfoflag moved to globtype
277
Revision 1.54 2004/05/02 11:48:46 peter
278
* strlenint is replaced with sizeint
280
Revision 1.53 2004/04/29 19:56:36 daniel
281
* Prepare compiler infrastructure for multiple ansistring types
283
Revision 1.52 2004/04/28 15:19:03 florian
284
+ syscall directive support for MorphOS added
286
Revision 1.51 2004/04/04 18:46:09 olle
287
+ added $APPTYPE TOOL for MPW tools on MacOS
289
Revision 1.50 2004/03/10 22:52:57 peter
291
* special mode -gv for valgrind compatible stabs
293
Revision 1.49 2004/02/15 16:34:18 marco
294
* pthread on -CURRENT related fixes.
296
Revision 1.48 2003/12/23 23:22:35 peter
297
* register calling is now default for i386
299
Revision 1.47 2003/12/14 20:51:17 daniel
300
* Register calling disabled again
302
Revision 1.46 2003/12/14 20:24:28 daniel
303
* Register allocator speed optimizations
304
- Worklist no longer a ringbuffer
305
- No find operations are left
306
- Simplify now done in constant time
307
- unusedregs is now a Tsuperregisterworklist
310
Revision 1.45 2003/12/04 23:27:32 peter
311
* remove redundant calls to add_edge_used
313
Revision 1.44 2003/11/07 15:58:32 florian
314
* Florian's culmutative nr. 1; contains:
315
- invalid calling conventions for a certain cpu are rejected
316
- arm softfloat calling conventions
317
- -Sp for cpu dependend code generation
319
- remaining code for value open array paras on heap
321
Revision 1.43 2003/09/28 13:39:58 peter
322
* default calling convention changed to stdcall
324
Revision 1.42 2003/09/07 22:09:35 peter
325
* preparations for different default calling conventions
328
Revision 1.41 2003/09/04 21:37:29 olle
329
+ added new lagnuage mode: MAC
331
Revision 1.40 2003/09/03 15:55:00 peter
332
* NEWRA branch merged
334
Revision 1.39 2003/08/09 18:56:54 daniel
335
* cs_regalloc renamed to cs_regvars to avoid confusion with register
337
* Some preventive changes to i386 spillinh code
339
Revision 1.38 2003/04/27 11:21:32 peter
340
* aktprocdef renamed to current_procdef
341
* procinfo renamed to current_procinfo
342
* procinfo will now be stored in current_module so it can be
344
* gen_main_procsym changed to create_main_proc and release_main_proc
345
to also generate a tprocinfo structure
346
* fixed unit implicit initfinal
348
Revision 1.37 2003/04/27 07:29:50 peter
349
* current_procdef cleanup, current_procdef is now always nil when parsing
350
a new procdef declaration
352
* lexlevel removed, use symtable.symtablelevel instead
353
* implicit init/final code uses the normal genentry/genexit
354
* funcret state checking updated for new funcret handling
356
Revision 1.36 2003/04/22 23:50:22 peter
357
* firstpass uses expectloc
358
* checks if there are differences between the expectloc and
359
location.loc from secondpass in EXTDEBUG
361
Revision 1.35 2003/03/08 08:59:07 daniel
362
+ $define newra will enable new register allocator
363
+ getregisterint will return imaginary registers with $newra
364
+ -sr switch added, will skip register allocation so you can see
365
the direct output of the code generator before register allocation
367
Revision 1.34 2002/10/16 19:01:43 peter
368
+ $IMPLICITEXCEPTIONS switch to turn on/off generation of the
369
implicit exception frames for procedures with initialized variables
370
and for constructors. The default is on for compatibility
372
Revision 1.33 2002/10/14 19:43:41 peter
373
* threading switch, defines the symbol FPC_THREADING
375
Revision 1.32 2002/10/05 12:43:24 carl
376
* fixes for Delphi 6 compilation
377
(warning : Some features do not work under Delphi)
379
Revision 1.31 2002/08/19 19:36:42 peter
380
* More fixes for cross unit inlining, all tnodes are now implemented
381
* Moved pocall_internconst to po_internconst because it is not a
382
calling type at all and it conflicted when inlining of these small
383
functions was requested
385
Revision 1.30 2002/08/12 15:08:39 carl
386
+ stab register indexes for powerpc (moved from gdb to cpubase)
387
+ tprocessor enumeration moved to cpuinfo
388
+ linker in target_info is now a class
389
* many many updates for m68k (will soon start to compile)
390
- removed some ifdef or correct them for correct cpu
392
Revision 1.29 2002/08/06 20:55:20 florian
393
* first part of ppc calling conventions fix
395
Revision 1.28 2002/07/04 20:43:00 florian
396
* first x86-64 patches
398
Revision 1.27 2002/07/01 18:46:22 peter
400
* reorganized aasm layer
402
Revision 1.26 2002/05/18 13:34:08 peter
403
* readded missing revisions
405
Revision 1.25 2002/05/16 19:46:36 carl
406
+ defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
407
+ try to fix temp allocation (still in ifdef)
408
+ generic constructor calls
409
+ start of tassembler / tmodulebase class cleanup
411
Revision 1.23 2002/05/12 16:53:05 peter
412
* moved entry and exitcode to ncgutil and cgobj
413
* foreach gets extra argument for passing local data to the
415
* -CR checks also class typecasts at runtime by changing them
417
* fixed compiler to cycle with the -CR option
418
* fixed stabs with elf writer, finally the global variables can
420
* removed a lot of routines from cga unit and replaced them by
422
* u32bit-s32bit updates for and,or,xor nodes. When one element is
423
u32bit then the other is typecasted also to u32bit without giving
424
a rangecheck warning/error.
425
* fixed pascal calling method with reversing also the high tree in
426
the parast, detected by tcalcst3 test
428
Revision 1.22 2002/04/21 19:02:03 peter
429
* removed newn and disposen nodes, the code is now directly
431
* -an option that will write the secondpass nodes to the .s file, this
432
requires EXTDEBUG define to actually write the info
433
* fixed various internal errors and crashes due recent code changes
435
Revision 1.21 2002/03/24 19:05:59 carl
436
+ patch for SPARC from Mazen NEIFER
438
Revision 1.20 2002/01/24 18:25:48 peter
439
* implicit result variable generation for assembler routines
440
* removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead