Change AnalysisConsumer to analyze functions created by instantiantiating a macro. Fixes PR 7361.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105984 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp
index 6a47279..0589008 100644
--- a/lib/Frontend/AnalysisConsumer.cpp
+++ b/lib/Frontend/AnalysisConsumer.cpp
@@ -278,8 +278,9 @@
// Don't run the actions on declarations in header files unless
// otherwise specified.
- if (!Opts.AnalyzeAll &&
- !Ctx->getSourceManager().isFromMainFile(D->getLocation()))
+ SourceManager &SM = Ctx->getSourceManager();
+ SourceLocation SL = SM.getInstantiationLoc(D->getLocation());
+ if (!Opts.AnalyzeAll && !SM.isFromMainFile(SL))
return;
// Clear the AnalysisManager of old AnalysisContexts.