internal.h (struct cpp_reader): Add new fields: nonexistent_file_hash and nonexistent_file_ob.

* 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.

From-SVN: r124929
This commit is contained in:
Ian Lance Taylor 2007-05-21 23:43:53 +00:00 committed by Ian Lance Taylor
parent a50411de14
commit 0b4cafec04
3 changed files with 93 additions and 4 deletions

View file

@ -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;