diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Symbol/Block.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'source/Symbol/Block.cpp')
-rw-r--r-- | source/Symbol/Block.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp index d0342355911c..6fe617080f96 100644 --- a/source/Symbol/Block.cpp +++ b/source/Symbol/Block.cpp @@ -1,9 +1,8 @@ //===-- Block.cpp -----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -17,6 +16,8 @@ #include "lldb/Symbol/VariableList.h" #include "lldb/Utility/Log.h" +#include <memory> + using namespace lldb; using namespace lldb_private; @@ -211,6 +212,21 @@ Block *Block::GetInlinedParent() { return nullptr; } +Block *Block::GetContainingInlinedBlockWithCallSite( + const Declaration &find_call_site) { + Block *inlined_block = GetContainingInlinedBlock(); + + while (inlined_block) { + const auto *function_info = inlined_block->GetInlinedFunctionInfo(); + + if (function_info && + function_info->GetCallSite().FileAndLineEqual(find_call_site)) + return inlined_block; + inlined_block = inlined_block->GetInlinedParent(); + } + return nullptr; +} + bool Block::GetRangeContainingOffset(const addr_t offset, Range &range) { const Range *range_ptr = m_ranges.FindEntryThatContains(offset); if (range_ptr) { @@ -364,8 +380,8 @@ void Block::AddChild(const BlockSP &child_block_sp) { void Block::SetInlinedFunctionInfo(const char *name, const char *mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr) { - m_inlineInfoSP.reset( - new InlineFunctionInfo(name, mangled, decl_ptr, call_decl_ptr)); + m_inlineInfoSP = std::make_shared<InlineFunctionInfo>(name, mangled, decl_ptr, + call_decl_ptr); } VariableListSP Block::GetBlockVariableList(bool can_create) { |