Interrogate should pick up definitions in all files explicitly named

This commit is contained in:
rdb 2015-12-26 15:24:19 +01:00
parent 46fe58a87a
commit cdc8d7d4d9
3 changed files with 17 additions and 3 deletions

View File

@ -1715,6 +1715,12 @@ handle_include_directive(const string &args, const YYLTYPE &loc) {
} else {
_last_c = '\0';
// If it was explicitly named on the command-line, mark it S_local.
filename.make_absolute();
if (_explicit_files.count(filename)) {
source = CPPFile::S_local;
}
CPPFile file(filename, filename_as_referenced, source);
// Don't include it if we included it before and it had #pragma once.

View File

@ -88,6 +88,8 @@ public:
Includes _quote_includes;
Includes _angle_includes;
set<Filename> _explicit_files;
// This is normally true, to indicate that the preprocessor should
// decode identifiers like foo::bar<snarf> into a single IDENTIFIER,
// TYPENAME_IDENTIFIER, or SCOPING token for yacc's convenience.

View File

@ -506,9 +506,15 @@ main(int argc, char **argv) {
build_c_wrappers = true;
}
// Get all of the .h files.
for (i = 1; i < argc; ++i)
{
// Add all of the .h files we are explicitly including to the parser.
for (i = 1; i < argc; ++i) {
Filename filename = Filename::from_os_specific(argv[i]);
filename.make_absolute();
parser._explicit_files.insert(filename);
}
// Now go through them again and feed them into the C++ parser.
for (i = 1; i < argc; ++i) {
Filename filename = Filename::from_os_specific(argv[i]);
if (!parser.parse_file(filename)) {
cerr << "Error parsing file: '" << argv[i] << "'\n";