[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
This commit is contained in:
Teresa Johnson 2017-03-24 17:59:06 +00:00
parent 80e3d5bb24
commit 428b9e0627
2 changed files with 5 additions and 0 deletions

View File

@ -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);
}

View File

@ -36,9 +36,12 @@ define void @internal3() {
ret void
}
declare void @external_decl()
define void @external1() alwaysinline !thinlto_src_module !0 {
call fastcc void @internal2()
call fastcc void @external2();
call void @external_decl();
ret void
}