Go to the source code of this file.
Namespaces | |
| namespace | audit_profiling_coverage |
Functions | |
| str | audit_profiling_coverage.blank_comments_and_strings (str text) |
| Replace comments, string and character literals with spaces, keeping offsets and newlines. | |
| audit_profiling_coverage.find_functions (str code) | |
| Locate top-level function definitions in comment- and string-blanked C code. | |
| audit_profiling_coverage.check_function (str code, int body_open, int body_close) | |
| Check one function body against the timer rules. | |
| bool | audit_profiling_coverage.ends_in_return (str body) |
| Whether a function body's last top-level statement is a return. | |
| int | audit_profiling_coverage.line_of (str text, int offset) |
| 1-based line number of an offset. | |
| int | audit_profiling_coverage.main () |
| Run the audit over src/*.c, include/*.h and tests/c, print problems. | |
Variables | |
| audit_profiling_coverage.REPO_ROOT = Path(__file__).resolve().parents[2] | |
| audit_profiling_coverage.SOURCES = sorted((REPO_ROOT / "src").glob("*.c")) | |
| dict | audit_profiling_coverage.EXCLUDED |
| dict | audit_profiling_coverage.EXCLUDED_FILES |
| audit_profiling_coverage.BEGIN_RE = re.compile(r"\bPROFILE_(?:FUNCTION|HELPER)_BEGIN\b") | |
| audit_profiling_coverage.END_TAIL_RE = re.compile(r"PROFILE_(?:FUNCTION|HELPER)_END\s*;\s*$") | |
| audit_profiling_coverage.RETURN_RE = re.compile(r"\b(?:return\b|PetscFunctionReturn(?:Void)?\s*\()") | |
| audit_profiling_coverage.FUNCT_RE = re.compile(r"\b__FUNCT__\b") | |
| dict | audit_profiling_coverage.CONTROL_WORDS = {"if", "for", "while", "switch", "return", "sizeof", "do", "else"} |