FreeBASIC  0.91.0
rtl-profile.bas
Go to the documentation of this file.
1 '' intrinsic runtime lib profiling functions
2 ''
3 '' chng: oct/2004 written [v1ctor]
4 
5 
6 #include once "fb.bi"
7 #include once "fbint.bi"
8 #include once "parser.bi"
9 #include once "ast.bi"
10 #include once "rtl.bi"
11 
12  dim shared as FB_RTL_PROCDEF funcdata( 0 to ... ) = _
13  { _
14 /' mcount cdecl ( void ) as void'/ _
15  ( _
16  @FB_RTL_PROFILEMCOUNT, @"mcount", _
17  FB_DATATYPE_VOID, FB_FUNCMODE_CDECL, _
18  NULL, FB_RTL_OPT_NONE, _
19  0 _
20  ), _
21 /' _monstartup CDECL ( ) as void '/ _
22  ( _
23  @FB_RTL_PROFILEMONSTARTUP, @"_monstartup", _
24  FB_DATATYPE_VOID, FB_FUNCMODE_CDECL, _
25  NULL, FB_RTL_OPT_NONE, _
26  0 _
27  ), _
28 /' EOL '/ _
29  ( _
30  NULL _
31  ) _
32  }
33 
36 end sub
37 
39  '' procs will be deleted when symbEnd is called
40 end sub
41 
42 function rtlProfileCall_mcount( ) as ASTNODE ptr
43  function = astNewCALL( PROCLOOKUP( PROFILEMCOUNT ), NULL )
44 end function
45 
47  '' on mingw monstartup has two flavours 'monstartup(2)' and '_monstartup(0)'
48  '' we are using the _monstartup(0) taking 0 arguments.
49  astAdd( astNewCALL( PROCLOOKUP( PROFILEMONSTARTUP ), NULL ) )
50 end sub
51