@@ -41,11 +41,11 @@ and a hashtable for each compilation unit.
41
41
$ mv main__A. odocl main__A
42
42
$ mv main__B. odocl main__B
43
43
$ mv main__C. odocl main__C
44
- $ odoc count-occurrences -I main -o main. occ
45
- $ odoc count-occurrences -I main__ -o main__. occ
46
- $ odoc count-occurrences -I main__A -o main__A. occ
47
- $ odoc count-occurrences -I main__B -o main__B. occ
48
- $ odoc count-occurrences -I main__C -o main__C. occ
44
+ $ odoc count-occurrences -I main -o occurrences- main. odoc
45
+ $ odoc count-occurrences -I main__ -o occurrences- main__. odoc
46
+ $ odoc count-occurrences -I main__A -o occurrences- main__A. odoc
47
+ $ odoc count-occurrences -I main__B -o occurrences- main__B. odoc
48
+ $ odoc count-occurrences -I main__C -o occurrences- main__C. odoc
49
49
50
50
The occurrences_print executable, available only for testing, unmarshal the file
51
51
and prints the number of occurrences in a readable format.
@@ -56,18 +56,18 @@ Uses of C are not counted, since the canonical destination (Main.C, generated by
56
56
Uses of B. Z are not counted since they go to a hidden module.
57
57
Uses of values Y. x and Z . y (in b. ml) are not counted since they come from a " local" module.
58
58
59
- $ occurrences_print main. occ | sort
59
+ $ occurrences_print occurrences- main. odoc | sort
60
60
Main was used directly 0 times and indirectly 2 times
61
61
Main. A was used directly 1 times and indirectly 0 times
62
62
Main. B was used directly 1 times and indirectly 0 times
63
63
64
- $ occurrences_print main__. occ | sort
64
+ $ occurrences_print occurrences- main__. odoc | sort
65
65
66
66
A only uses " persistent" values : one it defines itself.
67
- $ occurrences_print main__A. occ | sort
67
+ $ occurrences_print occurrences- main__A. odoc | sort
68
68
69
69
" Aliased" values are not counted since they become persistent
70
- $ occurrences_print main__B. occ | sort
70
+ $ occurrences_print occurrences- main__B. odoc | sort
71
71
Main was used directly 0 times and indirectly 7 times
72
72
Main. A was used directly 2 times and indirectly 5 times
73
73
Main. A. (|| > ) was used directly 1 times and indirectly 0 times
@@ -76,21 +76,21 @@ A only uses "persistent" values: one it defines itself.
76
76
Main. A. x was used directly 1 times and indirectly 0 times
77
77
78
78
" Aliased" values are not counted since they become persistent
79
- $ occurrences_print main__C. occ | sort
79
+ $ occurrences_print occurrences- main__C. odoc | sort
80
80
Main was used directly 0 times and indirectly 2 times
81
81
Main. A was used directly 1 times and indirectly 1 times
82
82
Main. A. x was used directly 1 times and indirectly 0 times
83
83
84
84
Now we can merge all tables
85
85
86
86
$ cat > files. map << EOF
87
- > main__A. occ
88
- > main__B. occ
89
- > main__C. occ
87
+ > occurrences- main__A. odoc
88
+ > occurrences- main__B. odoc
89
+ > occurrences- main__C. odoc
90
90
> EOF
91
- $ odoc aggregate-occurrences main. occ main__. occ -- file-list files. map -o aggregated. txt
91
+ $ odoc aggregate-occurrences occurrences- main. odoc occurrences- main__. odoc -- file-list files. map -o occurrences- aggregated. odoc
92
92
93
- $ occurrences_print aggregated. txt | sort > all_merged
93
+ $ occurrences_print occurrences- aggregated. odoc | sort > all_merged
94
94
$ cat all_merged
95
95
Main was used directly 0 times and indirectly 11 times
96
96
Main. A was used directly 4 times and indirectly 6 times
@@ -102,17 +102,26 @@ Now we can merge all tables
102
102
103
103
Compare with the one created directly with all occurrences:
104
104
105
- $ odoc count-occurrences -I . -o occurrences. txt
106
- $ occurrences_print occurrences. txt | sort > directly_all
105
+ $ odoc count-occurrences -I . -o occurrences-all . odoc
106
+ $ occurrences_print occurrences-all . odoc | sort > directly_all
107
107
$ diff all_merged directly_all
108
108
109
109
We can also include hidden ids:
110
110
111
- $ odoc count-occurrences -I main__A -o occurrences. txt -- include-hidden
112
- $ occurrences_print occurrences. txt | sort
111
+ $ odoc count-occurrences -I main__B -o occurrences-b. odoc -- include-hidden
112
+ $ occurrences_print occurrences-b. odoc | sort
113
+ Main was used directly 0 times and indirectly 7 times
114
+ Main. A was used directly 2 times and indirectly 5 times
115
+ Main. A. (|| > ) was used directly 1 times and indirectly 0 times
116
+ Main. A. M was used directly 2 times and indirectly 0 times
117
+ Main. A. t was used directly 1 times and indirectly 0 times
118
+ Main. A. x was used directly 1 times and indirectly 0 times
119
+ Main__ was used directly 0 times and indirectly 2 times
120
+ Main__. C was used directly 1 times and indirectly 1 times
121
+ Main__. C. y was used directly 1 times and indirectly 0 times
113
122
114
- $ odoc count-occurrences -I . -o occurrences. txt -- include-hidden
115
- $ occurrences_print occurrences. txt | sort
123
+ $ odoc count-occurrences -I . -o occurrences-all . odoc -- include-hidden
124
+ $ occurrences_print occurrences-all . odoc | sort
116
125
Main was used directly 0 times and indirectly 11 times
117
126
Main. A was used directly 4 times and indirectly 6 times
118
127
Main. A. (|| > ) was used directly 1 times and indirectly 0 times
0 commit comments