]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/file_analysis.c
tools: more intelligent caching for compile _info.
[ccan] / tools / ccanlint / file_analysis.c
index 8760630a7549e22a4d981c24fe69fab407d37043..575425df79e0c10ef993ae7f92747e70f3d8bdaf 100644 (file)
@@ -394,3 +394,13 @@ void score_file_error(struct score *score, struct ccan_file *f, unsigned line,
                score->error = talloc_append_string(score->error,
                                    "... more (use -vv to see them all)\n");
 }
+
+char *get_or_compile_info(const void *ctx, const char *dir)
+{
+       struct manifest *m = get_manifest(NULL, dir);
+
+       if (!m->info_file->compiled[COMPILE_NORMAL])
+               m->info_file->compiled[COMPILE_NORMAL] = compile_info(m, dir);
+
+       return m->info_file->compiled[COMPILE_NORMAL];
+}