aboutsummaryrefslogtreecommitdiff
path: root/Driver/DependencyFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Driver/DependencyFile.cpp')
-rw-r--r--Driver/DependencyFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Driver/DependencyFile.cpp b/Driver/DependencyFile.cpp
index 0d4ee91f01..673ca0734a 100644
--- a/Driver/DependencyFile.cpp
+++ b/Driver/DependencyFile.cpp
@@ -174,8 +174,11 @@ void DependencyFileCallback::FileChanged(SourceLocation Loc,
// #line markers to affect dependency generation!
SourceManager &SM = PP->getSourceManager();
- FileID FID = SM.getFileID(SM.getInstantiationLoc(Loc));
- const char *Filename = SM.getFileEntryForID(FID)->getName();
+ const FileEntry *FE =
+ SM.getFileEntryForID(SM.getFileID(SM.getInstantiationLoc(Loc)));
+ if (FE == 0) return;
+
+ const char *Filename = FE->getName();
if (!FileMatchesDepCriteria(Filename, FileType))
return;