diff options
Diffstat (limited to 'llvm/tools/llvm-profgen/ProfiledBinary.cpp')
-rw-r--r-- | llvm/tools/llvm-profgen/ProfiledBinary.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp index adf7770..aaf7a00 100644 --- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -100,26 +100,25 @@ BinarySizeContextTracker::getFuncSizeForContext(const SampleContext &Context) { PrevNode = CurrNode; CurrNode = CurrNode->getChildContext(ChildFrame.Location, ChildFrame.FuncName); - if (CurrNode && CurrNode->getFunctionSize().hasValue()) - Size = CurrNode->getFunctionSize().getValue(); + if (CurrNode && CurrNode->getFunctionSize()) + Size = CurrNode->getFunctionSize().value(); } // If we traversed all nodes along the path of the context and haven't // found a size yet, pivot to look for size from sibling nodes, i.e size // of inlinee under different context. - if (!Size.hasValue()) { + if (!Size) { if (!CurrNode) CurrNode = PrevNode; - while (!Size.hasValue() && CurrNode && - !CurrNode->getAllChildContext().empty()) { + while (!Size && CurrNode && !CurrNode->getAllChildContext().empty()) { CurrNode = &CurrNode->getAllChildContext().begin()->second; - if (CurrNode->getFunctionSize().hasValue()) - Size = CurrNode->getFunctionSize().getValue(); + if (CurrNode->getFunctionSize()) + Size = CurrNode->getFunctionSize().value(); } } - assert(Size.hasValue() && "We should at least find one context size."); - return Size.getValue(); + assert(Size && "We should at least find one context size."); + return Size.value(); } void BinarySizeContextTracker::trackInlineesOptimizedAway( |