diff options
author | Philip Reames <listmail@philipreames.com> | 2019-09-04 17:28:48 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-09-04 17:28:48 +0000 |
commit | 27820f99091d6547ed83ff20a2ea689ec68b9bf3 (patch) | |
tree | 38409c890311e770751e58f12beac22ea68f25e3 /llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp | |
parent | 2461061168f4ac4ca8a1823768a00d1c63355b1b (diff) | |
download | bcm5719-llvm-27820f99091d6547ed83ff20a2ea689ec68b9bf3.tar.gz bcm5719-llvm-27820f99091d6547ed83ff20a2ea689ec68b9bf3.zip |
[Instruction] Add hasMetadata(Kind) helper [NFC]
It's a common idiom, so let's add the obvious wrapper for metadata kinds which are basically booleans.
llvm-svn: 370933
Diffstat (limited to 'llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp b/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp index 1e9864a12d1..ea93f99d69e 100644 --- a/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp +++ b/llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp @@ -26,7 +26,7 @@ ImportedFunctionsInliningStatistics::createInlineGraphNode(const Function &F) { auto &ValueLookup = NodesMap[F.getName()]; if (!ValueLookup) { ValueLookup = std::make_unique<InlineGraphNode>(); - ValueLookup->Imported = F.getMetadata("thinlto_src_module") != nullptr; + ValueLookup->Imported = F.hasMetadata("thinlto_src_module"); } return *ValueLookup; } @@ -64,7 +64,7 @@ void ImportedFunctionsInliningStatistics::setModuleInfo(const Module &M) { if (F.isDeclaration()) continue; AllFunctions++; - ImportedFunctions += int(F.getMetadata("thinlto_src_module") != nullptr); + ImportedFunctions += int(F.hasMetadata("thinlto_src_module")); } } static std::string getStatString(const char *Msg, int32_t Fraction, int32_t All, |