![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Functions | |
| external_header (sym) | |
| layer_of (rel) | |
| build_index () | |
| _conditional_depth (text, offset) | |
| insert_includes (path, headers) | |
| main () | |
Variables | |
| REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| SRC = os.path.join(REPO, "src") | |
| dict | LAYER |
| list | EXTERNAL |
| list | MISSING |
| list | DECLARE |
| ENUM_MEMBER = re.compile(r"^\s*([A-Z][A-Z0-9_]{2,})\s*(?:=|,|$)") | |
| COMMENT_BLOCK = re.compile(r"/\*.*?\*/", re.S) | |
| COMMENT_LINE = re.compile(r"//[^\n]*") | |
Add the include that supplies each symbol the compiler says is missing.
Removing a god-header leaves files that were quietly living off what it dragged in. The
compiler names every one of them precisely -- `implicit declaration of function 'dt_print'`,
`'DT_DEBUG_CONTROL' undeclared` -- so the repair is mechanical: find which header declares the
symbol, add it, repeat until the build is clean.
Reads a compiler log on stdin (or a file), extracts the missing symbols per file, resolves
each against an index of every header under src/, and inserts the includes. A symbol declared
in more than one header is resolved by preferring the lowest layer -- a leaf library over a
module that re-exports it -- which is the include you want anyway.
Usage:
ninja -k 0 2>&1 | tools/fix_missing_includes.py [--dry-run]
|
protected |
How many #if/#ifdef blocks enclose `offset`.
Definition at line 126 of file fix_missing_includes.py.
References max.
Referenced by insert_includes().
| fix_missing_includes.build_index | ( | ) |
symbol -> [header relpaths], best candidate first.
Definition at line 94 of file fix_missing_includes.py.
References layer_of().
Referenced by main().
| fix_missing_includes.external_header | ( | sym | ) |
Definition at line 61 of file fix_missing_includes.py.
Referenced by main().
| fix_missing_includes.insert_includes | ( | path, | |
| headers | |||
| ) |
Definition at line 134 of file fix_missing_includes.py.
References _conditional_depth().
Referenced by main().
| fix_missing_includes.layer_of | ( | rel | ) |
Definition at line 89 of file fix_missing_includes.py.
Referenced by build_index().
| fix_missing_includes.main | ( | void | ) |
Definition at line 173 of file fix_missing_includes.py.
References build_index(), external_header(), insert_includes(), and main().
Referenced by main().
| fix_missing_includes.COMMENT_BLOCK = re.compile(r"/\*.*?\*/", re.S) |
Definition at line 85 of file fix_missing_includes.py.
| fix_missing_includes.COMMENT_LINE = re.compile(r"//[^\n]*") |
Definition at line 86 of file fix_missing_includes.py.
| list fix_missing_includes.DECLARE |
Definition at line 75 of file fix_missing_includes.py.
Definition at line 83 of file fix_missing_includes.py.
| list fix_missing_includes.EXTERNAL |
Definition at line 43 of file fix_missing_includes.py.
| dict fix_missing_includes.LAYER |
Definition at line 28 of file fix_missing_includes.py.
| list fix_missing_includes.MISSING |
Definition at line 68 of file fix_missing_includes.py.
| fix_missing_includes.REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
Definition at line 23 of file fix_missing_includes.py.
| fix_missing_includes.SRC = os.path.join(REPO, "src") |
Definition at line 24 of file fix_missing_includes.py.