PmAbcMagic.dcl 2.48 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
definition module PmAbcMagic

import StdFile, StdMaybe
import UtilStrictLists, StdPathname
5
6
from UtilDate	import :: DATE
from PmTypes	import :: LinkObjFileName, :: LinkLibraryName, :: Modulename
7
from Directory	import :: DateTime, :: Date, :: Time
8
from PmDirCache	import :: DirCache
Diederik van Arkel's avatar
Diederik van Arkel committed
9
10
11
12
13
14
15
16
17

//	Compiler options that are stored in the abc file
::	ABCOptions		=
	{	abcMemoryProfile 		:: !Bool // -desc
	,	abcTimeProfile			:: !Bool
	,	abcStrictnessAnalysis	:: !Bool
	,	abcGiveWarnings			:: !Bool //.
	,	abcBeVerbose			:: !Bool //--> now abused for -exl flag
	,	abcGenerateComments		:: !Bool
18
19
	,	abcReuseUniqueNodes 	:: !Bool
	,	abcFusion				:: !Bool
Diederik van Arkel's avatar
Diederik van Arkel committed
20
21
22
23
24
25
26
	}
DefaultABCOptions		:: ABCOptions


:: *ABCCache
:: ModuleDate :== DateTime

27
AC_Init :: ABCCache
Diederik van Arkel's avatar
Diederik van Arkel committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

Combined ::
	!Pathname
	!DATE
	!ABCCache
	!Files
	->
	(!((!Bool, !Bool, !Int, !ABCOptions
	),(!List Modulename, !Maybe ModuleDate, !List ModuleDate, !List LinkObjFileName, !List LinkLibraryName
	),!ABCCache),!Files)

//	Returns further info from an .abc file:
GetABCCompiledInfo ::
	!Bool									// require update abcinfo?
	!Pathname								// full path name of the .abc file.
	!ABCCache								// 
	!Files									// Input filesystem
	->
	((!Bool									// is this module a system file?
	, !Bool									// does this .abc file contain sequential stack info?
	, !Int									// version number of compiler which generated the .abc file (-1 if .abc file could not be read).
	, !ABCOptions							// compiler options this .abc file was generated with (except 'Show Type Info').
	, !ABCCache								// 
	),!Files								// The new filesystem
	)

ParseABCDependencies` ::
	!Pathname								// The full .abc path name
	!DATE									// .abc last modified date
	!*ABCCache								// 
	!Files									// Input filesystem
	->
	((!Bool									// Indication whether .abc file could be read
	, !List Modulename						// The list of dependencies
	, !Maybe ModuleDate						// 
	, !List ModuleDate						// 
	, !List LinkObjFileName					// The list of dependant object files
	, !List LinkLibraryName					// The list of dependant (dynamic) library files
	, !*ABCCache							// 
	), !Files								// The new filesystem
	);

PatchABCDates ::
	!Pathname								// 
	!*DirCache								// 
	!*Files									// Input filesystem
	->
	((Bool									// 
	, *DirCache								// 
	),*Files								// The new filesystem
	)

PatchSystemABC ::
	!Int									// 
	!Bool									// 
	!Pathname								// 
	!Bool									// 
	!*Files									// Input filesystem
	->
	( !Bool									// 
	, !*Files								// The new filesystem
	)