@@ -147,6 +147,7 @@ extern struct symbol_list *sparse_initialize(int argc, char **argv, struct strin
extern struct symbol_list *__sparse(char *filename);
extern struct symbol_list *sparse_keep_tokens(char *filename);
extern struct symbol_list *sparse(char *filename);
+extern void report_stats(void);
static inline int symbol_list_size(struct symbol_list *list)
{
@@ -1166,5 +1166,6 @@ int main(int argc, char **argv)
LLVMDisposeModule(module);
+ report_stats();
return 0;
}
@@ -351,6 +351,10 @@ Dump the IR code of a function directly after its linearization,
before any simplifications is made. If the argument \fB=only\fR is
also given no further processing is done on the function.
.
+.TP
+.B \-fmem-report
+Report some statistics about memory allocation used by the tool.
+.
.SH OTHER OPTIONS
.TP
.B \-ftabstop=WIDTH
@@ -302,5 +302,7 @@ int main(int argc, char **argv)
FOR_EACH_PTR_NOTAG(filelist, file) {
check_symbols(sparse(file));
} END_FOR_EACH_PTR_NOTAG(file);
+
+ report_stats();
return 0;
}
@@ -54,3 +54,9 @@ void show_allocation_stats(void)
show_stats(NULL, &tot);
}
+
+void report_stats(void)
+{
+ if (fmem_report)
+ show_allocation_stats();
+}
@@ -61,5 +61,7 @@ int main(int argc, char **argv)
FOR_EACH_PTR_NOTAG(filelist, file) {
clean_up_symbols(sparse(file));
} END_FOR_EACH_PTR_NOTAG(file);
+
+ report_stats();
return 0;
}
@@ -82,5 +82,6 @@ int main(int argc, char **argv)
compile(sparse(file));
} END_FOR_EACH_PTR_NOTAG(file);
+ report_stats();
return 0;
}
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- lib.h | 1 + sparse-llvm.c | 1 + sparse.1 | 4 ++++ sparse.c | 2 ++ stats.c | 6 ++++++ test-linearize.c | 2 ++ test-unssa.c | 1 + 7 files changed, 17 insertions(+)