From 2995e59834500a8fcbd6faca34bc17f8dcbb059b Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Tue, 29 Jun 2021 20:48:05 +0000 Subject: [PATCH] [asmxygen] Implement --stats key git-svn-id: svn://kolibrios.org@8982 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/asmxygen.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/kernel/trunk/asmxygen.py b/kernel/trunk/asmxygen.py index 8ec83fb278..a4b5cc37a7 100644 --- a/kernel/trunk/asmxygen.py +++ b/kernel/trunk/asmxygen.py @@ -1963,9 +1963,6 @@ if dump_symbols: for asm_element in elements: asm_element.dump() -if print_stats: - print("--stats is not nimplmented") - if clean_generated_stuff: kernel_files_set = set(kernel_files) for file in kernel_files: @@ -1983,5 +1980,32 @@ elif not noemit: element.emit(doxygen_src_path) i += 1 +if print_stats: + var_count = 0 + mac_count = 0 + lab_count = 0 + fun_count = 0 + uni_count = 0 + str_count = 0 + for element in elements: + if type(element) == AsmVariable: + var_count += 1 + elif type(element) == AsmMacro: + mac_count += 1 + elif type(element) == AsmLabel: + lab_count += 1 + elif type(element) == AsmFunction: + fun_count += 1 + elif type(element) == AsmUnion: + uni_count += 1 + elif type(element) == AsmStruct: + str_count += 1 + print(f'Parsed variable count: {var_count}') + print(f'Parsed macro count: {mac_count}') + print(f'Parsed label count: {lab_count}') + print(f'Parsed function count: {fun_count}') + print(f'Parsed union type count: {uni_count}') + print(f'Parsed structure type count: {str_count}') + if enable_warnings: open('asmxygen.txt', "w", encoding = "utf-8").write(warnings)