-
Notifications
You must be signed in to change notification settings - Fork 25
/
TODO
105 lines (68 loc) · 3.15 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
-*- mode: Text -*-
--------------------------------------------------------------------
C-Vise pre-release list:
- make sure copyright years are up to date
- test on Windows, Linux, OS X
--------------------------------------------------------------------
C-Vise TODO list:
turn
if (foo) goto bar; baz; bar:
into
if (!foo) baz
it would be nice to have a way to glue multiple C/C++ files into a
single compilation unit, as an alternative to multi-file reduction
- CIL can do this but it's pretty invasive
make llvm-svn-compatible build against a specific LLVM version
the CI is the problem here
could solve it like we do in Souper with a pre-built LLVM tarball
add modes for Rust and Javascript
add optional pass timeout?
more shortcut keys?
constant folding
partial #define processing
remove zero-length files at the end of reduction?
in localize_headers, correctly deal with the case where the
original C/C++ file is in the current dir
maybe implement passes to:
ensure that identifiers first appear in sorted order
identifiers are dense
reduce the non-header-file part first, and use PCHs
merge adjacent strings
maybe add a format string reduction pass that eliminates a format
specifier and also the corresponding argument
write some documentation about creating a c-vise pass: side effects,
directory restrictions, etc.
Konstantin suggestion:
deal with un-preprocessed code in a smart way, for example by
incrementally preprocessing files from inside c-vise
implement suggestion from Joerg Sonnenberger:
do transformations in chunks, like the line-reducer pass already does
requires a good model of when this will be profitable
--------------------------------------------------------------------
clang_delta TODO list:
keep working to eliminate template stuff
replace for-loops with expressions guessed from initializers
guess that it executes 0 and 1 times
change operators to other operators, e.g., replace / with +
- From Konstantin Tokarev
As you may know, there is a clang-based tool "Include What You Use"
[1]. I think similar approach could be useful in C-Vise to remove
whole header files instead of separate lines. Though I'm not sure it's
feasible without non-preprocessed source file and compilation command
line available.
I can imagine the next algorithm of reduction:
1. Reduce only the last section of translation unit corresponding to
original source file without #includes using all available passes.
2. Try to remove sections corresponding to "unused" headers
3. Move to section N-1 and proceed.
Assuming that "interesting" fragment of code is located in sections
with big numbers (source file and local headers) while first sections
contain library headers, this approach might be more efficient than
traditional line-based reduction.
[1] http://code.google.com/p/include-what-you-use
- (low priority) format string reductions:
* remove anything that's not a %d or whatever from the format string
* remove a %d directive and also the corresponding argument from a printf
- (low priority) constant-propagation
- (low priority) replace peephole passes in c_vise
--------------------------------------------------------------------