When running the GRSimpleVals analysis, skip functions that do not
appear in a file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47491 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index 9dcc28a..2b205f0 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -604,9 +604,11 @@
if (FName.size() > 0 && FName != FD.getIdentifier()->getName())
return;
- if (FD.getLocation().getFileID() != Ctx->getSourceManager().getMainFileID())
- return;
+ SourceLocation Loc = FD.getLocation();
+ if (!Loc.isFileID() ||
+ Loc.getFileID() != Ctx->getSourceManager().getMainFileID())
+ return;
if (!Visualize) {
llvm::cerr << "ANALYZE: " << FD.getIdentifier()->getName() << ' '