| |
| /pliant/language/optimizer/gcc_base.pli |
| |
| 1 |
scope "/pliant/language/" "/pliant/install/" | |
| 2 |
| |
| 3 |
module "/pliant/language/basic/unsafe.pli" | |
| 4 |
module "/pliant/language/context/internals.pli" | |
| 5 |
module "/pliant/language/compiler/internals.pli" | |
| 6 |
| |
| 7 |
| |
| 8 |
method e size -> s | |
| 9 |
arg Expression e ; arg Int s | |
| 10 |
return e:arguments:size | |
| 11 |
| |
| 12 |
method e '' i -> ei | |
| 13 |
arg Expression e ; arg Int i ; arg_C Expression ei | |
| 14 |
return (e:arguments:i map Expression) | |
| 15 |
| |
| 16 |
| |
| 17 |
gvar CBool gcc_is_available := false | |
| 18 |
gvar CBool gcc_is_active := false | |
| 19 |
gvar CBool gcc_verbose := false | |
| 20 |
gvar Str gcc_listing_filename | |
| 21 |
gvar Relation gcc_inline_functions # C inline functions | |
| 22 |
gvar Relation gcc_inline_instructions | |
| 23 |
gvar Relation gcc_compare_functions | |
| 24 |
gvar List gcc_inline_generators | |
| 25 |
| |
| 26 |
| |
| 27 |
function gcc_on | |
| 28 |
gcc_is_active := gcc_is_available | |
| 29 |
| |
| 30 |
meta gcc_on e | |
| 31 |
if e:size=1 | |
| 32 |
var CBool memo := gcc_is_active | |
| 33 |
gcc_is_active := gcc_is_available | |
| 34 |
e:0:compile | |
| 35 |
e suckup e:0 | |
| 36 |
gcc_is_active := memo | |
| 37 |
e set_void_result | |
| 38 |
| |
| 39 |
function gcc_off | |
| 40 |
gcc_is_active := false | |
| 41 |
| |
| 42 |
meta gcc_off e | |
| 43 |
if e:size=1 | |
| 44 |
var CBool memo := gcc_is_active | |
| 45 |
gcc_is_active := false | |
| 46 |
e:0:compile | |
| 47 |
e suckup e:0 | |
| 48 |
gcc_is_active := memo | |
| 49 |
e set_void_result | |
| 50 |
| |
| 51 |
meta gcc_listing e | |
| 52 |
if e:size=1 and (e:0 constant Str)<>null | |
| 53 |
if gcc_is_active | |
| 54 |
gcc_listing_filename := (e:0 constant Str) map Str | |
| 55 |
gcc_verbose := true | |
| 56 |
e set_void_result | |
| 57 |
| |
| 58 |
| |
| 59 |
function gcc_inline_meta e always r | |
| 60 |
arg_rw Expression e; arg CBool always ; arg_rw Relation r | |
| 61 |
var Pointer:Arrow c :> pliant_general_dictionary first "pliant function" | |
| 62 |
if c=null or (addressof entry_type:c)<>addressof:Function | |
| 63 |
return | |
| 64 |
var Pointer:Function fun :> c map Function | |
| 65 |
if e:size=1 and (e:0 constant Str)<>null | |
| 66 |
if always or pliant_debugging_level_variable<2 | |
| 67 |
var Link:Str s :> new Str | |
| 68 |
s := (e:0 constant Str) map Str | |
| 69 |
r define addressof:fun null addressof:s | |
| 70 |
e set_void_result | |
| 71 |
| |
| 72 |
meta gcc_inline e | |
| 73 |
gcc_inline_meta e true gcc_inline_functions | |
| 74 |
| |
| 75 |
meta gcc_nocheck_inline e | |
| 76 |
gcc_inline_meta e false gcc_inline_functions | |
| 77 |
| |
| 78 |
meta gcc_inline_compare e | |
| 79 |
gcc_inline_meta e true gcc_compare_functions | |
| 80 |
| |
| 81 |
| |
| 82 |
export gcc_on gcc_off gcc_listing | |
| 83 |
export gcc_inline gcc_nocheck_inline gcc_inline_compare | |
| 84 |
export gcc_is_available gcc_is_active gcc_verbose gcc_listing_filename gcc_inline_functions gcc_inline_instructions gcc_compare_functions gcc_inline_generators | |
| 85 |
| |
| 86 |
| |
| 87 |
public | |
| 88 |
| |
| 89 |
type DebuggerInstructionRecord | |
| 90 |
field Int code_offset | |
| 91 |
field ListingPositions position | |
| 92 |
field Int profiler_counter <- 0 | |
| 93 |
| |
| 94 |
type DebuggerVariableRecord | |
| 95 |
field Int stack_offset | |
| 96 |
field Str name | |
| 97 |
field Link:Type type | |
| |