From a5fa3cc54ea4b30663eedc2e500dd0d646145529 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 7 Dec 2025 15:34:15 +0800 Subject: libcpp: adjust _cpp_file accessors Back in r78875 mrs added cpp_get_path/dir accessors for _cpp_file in order to interface with the darwin framework system. But now I notice that the latter duplicates the better-named _cpp_get_file_dir, and I'm inclined to rename the former to match. Perhaps we should drop the initial underscore since these are no longer internal interfaces; OTOH, _cpp_hashnode_value and _cpp_backup_tokens still have the initial underscore in cpplib.h. libcpp/ChangeLog: * include/cpplib.h (cpp_get_path, cpp_get_dir): Remove. (_cpp_get_file_path, _cpp_get_file_name, _cpp_get_file_stat) (_cpp_get_file_dir): Move prototypes from... * internal.h: ...here. * files.cc (_cpp_get_file_path): Rename from... (cpp_get_path): ...this. (cpp_get_dir): Remove. gcc/ChangeLog: * config/darwin-c.cc (find_subframework_header): Use _cpp_get_file_*. --- libcpp/include/cpplib.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libcpp/include/cpplib.h') diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 5190ff7..16f030c 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -1563,8 +1563,10 @@ extern void cpp_make_system_header (cpp_reader *, int, int); extern bool cpp_push_include (cpp_reader *, const char *); extern bool cpp_push_default_include (cpp_reader *, const char *); extern void cpp_change_file (cpp_reader *, enum lc_reason, const char *); -extern const char *cpp_get_path (struct _cpp_file *); -extern cpp_dir *cpp_get_dir (struct _cpp_file *); +extern const char *_cpp_get_file_path (_cpp_file *); +extern const char *_cpp_get_file_name (_cpp_file *); +extern struct stat *_cpp_get_file_stat (_cpp_file *); +extern struct cpp_dir *_cpp_get_file_dir (_cpp_file *); extern cpp_buffer *cpp_get_buffer (cpp_reader *); extern struct _cpp_file *cpp_get_file (cpp_buffer *); extern cpp_buffer *cpp_get_prev (cpp_buffer *); -- cgit v1.1