1# * Copyright 2015, NICTA
2# *
3# * This software may be distributed and modified according to the terms of
4# * the BSD 2-Clause license. Note that NO WARRANTY is provided.
5# * See "LICENSE_BSD2.txt" for details.
6# *
7# * @TAG(NICTA_BSD)
8
9from target_objects import target_dir, structs, functions, const_globals
10from target_objects import symbols, sections, rodata, pairings, danger_set
11
12import syntax
13import objdump
14import logic
15
16f = open ('%s/Functions.txt' % target_dir)
17syntax.parse_and_install_all (f, None)
18f.close ()
19
20print 'Checking.'
21syntax.check_funs (functions)
22
23#print 'Pseudo-Compiling.'
24#pseudo_compile.compile_funcs (functions)
25
26#print 'Duplicate-sharing.'
27#pseudo_compile.combine_function_duplicates (functions)
28
29def run_pairings ():
30	for f in functions:
31		if f.startswith ('C.'):
32			f2 = 'mc_' + f[2:]
33		else:
34			f2 = f + '_impl'
35		if f2 in functions:
36			pair = logic.mk_pairing (functions, f, f2)
37			pairings[f] = [pair]
38			pairings[f2] = [pair]
39	print '%d pairing halves built.' % (len (pairings))
40
41run_pairings ()
42
43
44