diff options
Diffstat (limited to 'llvm/lib/DebugInfo/GSYM/InlineInfo.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/GSYM/InlineInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp b/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp index f775ab8fb65c..ecfb21501eda 100644 --- a/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp +++ b/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp @@ -264,3 +264,14 @@ llvm::Error InlineInfo::encode(FileWriter &O, uint64_t BaseAddr) const { } return Error::success(); } + +static uint64_t GetTotalNumChildren(const InlineInfo &II) { + uint64_t NumChildren = II.Children.size(); + for (const auto &Child : II.Children) + NumChildren += GetTotalNumChildren(Child); + return NumChildren; +} + +bool InlineInfo::operator<(const InlineInfo &RHS) const { + return GetTotalNumChildren(*this) < GetTotalNumChildren(RHS); +} |
