@@ -513,6 +513,19 @@ get_added_cpp_dirs (incpath_kind chain)
return heads[chain];
}
+/* Free all cpp dirs. */
+void
+free_cpp_dirs (void)
+{
+ struct cpp_dir **pcur, *cur;
+ for (pcur = &heads[INC_QUOTE]; *pcur;)
+ {
+ cur = *pcur;
+ *pcur = cur->next;
+ free_path (cur, REASON_QUIET);
+ }
+}
+
#if !(defined TARGET_EXTRA_INCLUDES) || !(defined TARGET_EXTRA_PRE_INCLUDES)
static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED,
const char *iprefix ATTRIBUTE_UNUSED,
@@ -34,6 +34,7 @@ extern void register_include_chains (cpp_reader *, const char *,
int, int, int);
extern void add_cpp_dir_path (struct cpp_dir *, incpath_kind);
extern struct cpp_dir *get_added_cpp_dirs (incpath_kind);
+extern void free_cpp_dirs(void);
struct target_c_incpath_s {
/* Do extra includes processing. STDINC is false iff -nostdinc was given. */
From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> gcc/ChangeLog: * incpath.c (free_cpp_dirs): New function. * incpath.h (free_cpp_dirs): Ditto. --- This adds a helper to allow the fortran FE to free it's include dirs. Bootstrapped and regtested without new regressions on x86_64-unknown-linux. Ok for trunk? --- gcc/incpath.c | 13 +++++++++++++ gcc/incpath.h | 1 + 2 files changed, 14 insertions(+)