summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2017-03-24 17:59:06 +0000
committerTeresa Johnson <tejohnson@google.com>2017-03-24 17:59:06 +0000
commit428b9e0627883ff2b736f191f66dfdc0ef6b48e0 (patch)
tree44a19c25c68c118621ac8f6eb471182f9e47e1c1 /llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
parent80e3d5bb24ad24f42c8a2da8e8091ddc17dfee61 (diff)
downloadbcm5719-llvm-428b9e0627883ff2b736f191f66dfdc0ef6b48e0.tar.gz
bcm5719-llvm-428b9e0627883ff2b736f191f66dfdc0ef6b48e0.zip
[ThinLTO] Correct counting of functions in inliner stats
Summary: Declarations need to be filtered out when counting functions. Reviewers: eraman Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31336 llvm-svn: 298720
Diffstat (limited to 'llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp b/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
index ed018bb7310..b8c12ad5ea8 100644
--- a/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
+++ b/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
@@ -62,6 +62,8 @@ void ImportedFunctionsInliningStatistics::recordInline(const Function &Caller,
void ImportedFunctionsInliningStatistics::setModuleInfo(const Module &M) {
ModuleName = M.getName();
for (const auto &F : M.functions()) {
+ if (F.isDeclaration())
+ continue;
AllFunctions++;
ImportedFunctions += int(F.getMetadata("thinlto_src_module") != nullptr);
}
OpenPOWER on IntegriCloud