summaryrefslogtreecommitdiffstats
path: root/contrib/gcclibs/libcpp/internal.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-11-16 01:07:02 +0000
committerpfg <pfg@FreeBSD.org>2013-11-16 01:07:02 +0000
commitd27f7c2a842e4f80ea9a2408d941730107efd355 (patch)
treeaeaba23e8862c5a47c20ef7eff077d79a61647c2 /contrib/gcclibs/libcpp/internal.h
parent43666eab78b10808646ed428d2019b2dcf0d92f0 (diff)
downloadFreeBSD-src-d27f7c2a842e4f80ea9a2408d941730107efd355.zip
FreeBSD-src-d27f7c2a842e4f80ea9a2408d941730107efd355.tar.gz
libcpp: preprocessor speedup patches from mainline.
* lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't look backward at the end of the line unless we saw a backslash. * internal.h (struct cpp_reader): Add new fields: nonexistent_file_hash and nonexistent_file_ob. * files.c: Include "obstack.h". (find_file_in_dir): Before trying to open the file, look up the path name in the hash table of nonexistent files. After failing to open the file, add the path name to the hash table. (_cpp_find_file): Cache the results of looking up the file name starting with the quote and bracket chain heads, if we can. (nonexistent_file_hash_eq): New static function. (_cpp_init_files): Initialize pfile->nonexistent_file_hash and pfile->nonexistent_file_ob. (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and pfile->nonexistent_file_ob. Obtained from: gcc 4.3 (rev. 120263, 124929 ; GPLv2) MFC after: 3 weeks
Diffstat (limited to 'contrib/gcclibs/libcpp/internal.h')
-rw-r--r--contrib/gcclibs/libcpp/internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/gcclibs/libcpp/internal.h b/contrib/gcclibs/libcpp/internal.h
index addff61..1661f7a 100644
--- a/contrib/gcclibs/libcpp/internal.h
+++ b/contrib/gcclibs/libcpp/internal.h
@@ -355,6 +355,10 @@ struct cpp_reader
struct file_hash_entry *file_hash_entries;
unsigned int file_hash_entries_allocated, file_hash_entries_used;
+ /* Negative path lookup hash table. */
+ struct htab *nonexistent_file_hash;
+ struct obstack nonexistent_file_ob;
+
/* Nonzero means don't look for #include "foo" the source-file
directory. */
bool quote_ignores_source_dir;
OpenPOWER on IntegriCloud