forked from OSchip/llvm-project
Include the filename being looked up in an error message. This gives us stuff
like this: t3.c:5:10: error: 'vers2.h' file not found #include xstr(INCFILE(2).h) ^ instead of: t3.c:5:10: error: file not found #include xstr(INCFILE(2).h) ^ which is useful if the #include name is generated through macro expansion. llvm-svn: 39398
This commit is contained in:
parent
86054a9634
commit
7c718bd5a4
|
@ -272,7 +272,8 @@ void Preprocessor::HandlePragmaDependency(LexerToken &DependencyTok) {
|
|||
const FileEntry *File = LookupFile(FilenameStart, FilenameEnd,
|
||||
isAngled, 0, CurDir);
|
||||
if (File == 0)
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found);
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found,
|
||||
std::string(FilenameStart, FilenameEnd));
|
||||
|
||||
unsigned FileID = getCurrentFileLexer()->getCurFileID();
|
||||
const FileEntry *CurFile = SourceMgr.getFileEntryForFileID(FileID);
|
||||
|
|
|
@ -1573,7 +1573,8 @@ void Preprocessor::HandleIncludeDirective(LexerToken &IncludeTok,
|
|||
const FileEntry *File = LookupFile(FilenameStart, FilenameEnd,
|
||||
isAngled, LookupFrom, CurDir);
|
||||
if (File == 0)
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found);
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found,
|
||||
std::string(FilenameStart, FilenameEnd));
|
||||
|
||||
// Ask HeaderInfo if we should enter this #include file.
|
||||
if (!HeaderInfo.ShouldEnterIncludeFile(File, isImport)) {
|
||||
|
@ -1584,7 +1585,8 @@ void Preprocessor::HandleIncludeDirective(LexerToken &IncludeTok,
|
|||
// Look up the file, create a File ID for it.
|
||||
unsigned FileID = SourceMgr.createFileID(File, FilenameTok.getLocation());
|
||||
if (FileID == 0)
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found);
|
||||
return Diag(FilenameTok, diag::err_pp_file_not_found,
|
||||
std::string(FilenameStart, FilenameEnd));
|
||||
|
||||
// Finally, if all is good, enter the new file!
|
||||
EnterSourceFile(FileID, CurDir);
|
||||
|
|
|
@ -156,7 +156,7 @@ DIAG(err_pp_invalid_directive, ERROR,
|
|||
DIAG(err_pp_hash_error, ERROR,
|
||||
"#error%s")
|
||||
DIAG(err_pp_file_not_found, ERROR,
|
||||
"file not found")
|
||||
"'%s' file not found")
|
||||
DIAG(err_pp_empty_filename, ERROR,
|
||||
"empty filename")
|
||||
DIAG(err_pp_include_too_deep, ERROR,
|
||||
|
|
Loading…
Reference in New Issue