aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r--clang/lib/Lex/PPLexerChange.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp
index 802172693960..b7c7e2693ef1 100644
--- a/clang/lib/Lex/PPLexerChange.cpp
+++ b/clang/lib/Lex/PPLexerChange.cpp
@@ -24,8 +24,6 @@
#include "llvm/Support/Path.h"
using namespace clang;
-PPCallbacks::~PPCallbacks() {}
-
//===----------------------------------------------------------------------===//
// Miscellaneous Methods.
//===----------------------------------------------------------------------===//
@@ -81,7 +79,7 @@ bool Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir,
if (Invalid) {
SourceLocation FileStart = SourceMgr.getLocForStartOfFile(FID);
Diag(Loc, diag::err_pp_error_opening_file)
- << std::string(SourceMgr.getBufferName(FileStart)) << "";
+ << std::string(SourceMgr.getBufferName(FileStart)) << "";
return true;
}
@@ -417,7 +415,10 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
}
if (!isEndOfMacro && CurPPLexer &&
- SourceMgr.getIncludeLoc(CurPPLexer->getFileID()).isValid()) {
+ (SourceMgr.getIncludeLoc(CurPPLexer->getFileID()).isValid() ||
+ // Predefines file doesn't have a valid include location.
+ (PredefinesFileID.isValid() &&
+ CurPPLexer->getFileID() == PredefinesFileID))) {
// Notify SourceManager to record the number of FileIDs that were created
// during lexing of the #include'd file.
unsigned NumFIDs =