Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb][NFC] Move some ctors and tors to cpp files #67165

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lldb/include/lldb/Core/UserSettingsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ namespace lldb_private {

class Properties {
public:
Properties() = default;
Properties();

Properties(const lldb::OptionValuePropertiesSP &collection_sp)
: m_collection_sp(collection_sp) {}
Properties(const lldb::OptionValuePropertiesSP &collection_sp);

virtual ~Properties() = default;
virtual ~Properties();

virtual lldb::OptionValuePropertiesSP GetValueProperties() const {
// This function is virtual in case subclasses want to lazily implement
Expand Down
22 changes: 6 additions & 16 deletions lldb/include/lldb/Symbol/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ using CallSiteParameterArray = llvm::SmallVector<CallSiteParameter, 0>;
class CallEdge {
public:
enum class AddrType : uint8_t { Call, AfterCall };
virtual ~CallEdge() = default;
~CallEdge();

/// Get the callee's definition.
///
Expand Down Expand Up @@ -305,10 +305,7 @@ class CallEdge {

protected:
CallEdge(AddrType caller_address_type, lldb::addr_t caller_address,
bool is_tail_call, CallSiteParameterArray &&parameters)
: caller_address(caller_address),
caller_address_type(caller_address_type), is_tail_call(is_tail_call),
parameters(std::move(parameters)) {}
bool is_tail_call, CallSiteParameterArray &&parameters);

/// Helper that finds the load address of \p unresolved_pc, a file address
/// which refers to an instruction within \p caller.
Expand Down Expand Up @@ -339,11 +336,7 @@ class DirectCallEdge : public CallEdge {
/// return PC within the calling function to identify a specific call site.
DirectCallEdge(const char *symbol_name, AddrType caller_address_type,
lldb::addr_t caller_address, bool is_tail_call,
CallSiteParameterArray &&parameters)
: CallEdge(caller_address_type, caller_address, is_tail_call,
std::move(parameters)) {
lazy_callee.symbol_name = symbol_name;
}
CallSiteParameterArray &&parameters);

Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;

Expand All @@ -370,12 +363,9 @@ class IndirectCallEdge : public CallEdge {
public:
/// Construct a call edge using a DWARFExpression to identify the callee, and
/// a return PC within the calling function to identify a specific call site.
IndirectCallEdge(DWARFExpressionList call_target, AddrType caller_address_type,
lldb::addr_t caller_address, bool is_tail_call,
CallSiteParameterArray &&parameters)
: CallEdge(caller_address_type, caller_address, is_tail_call,
std::move(parameters)),
call_target(std::move(call_target)) {}
IndirectCallEdge(DWARFExpressionList call_target,
AddrType caller_address_type, lldb::addr_t caller_address,
bool is_tail_call, CallSiteParameterArray &&parameters);

Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;

Expand Down
7 changes: 7 additions & 0 deletions lldb/source/Core/UserSettingsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class Property;
using namespace lldb;
using namespace lldb_private;

Properties::Properties() = default;

Properties::Properties(const lldb::OptionValuePropertiesSP &collection_sp)
: m_collection_sp(collection_sp) {}

Properties::~Properties() = default;

lldb::OptionValueSP
Properties::GetPropertyValue(const ExecutionContext *exe_ctx,
llvm::StringRef path, Status &error) const {
Expand Down
25 changes: 25 additions & 0 deletions lldb/source/Symbol/Function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ size_t InlineFunctionInfo::MemorySize() const {
/// @name Call site related structures
/// @{

CallEdge::~CallEdge() = default;

CallEdge::CallEdge(AddrType caller_address_type, lldb::addr_t caller_address,
bool is_tail_call, CallSiteParameterArray &&parameters)
: caller_address(caller_address), caller_address_type(caller_address_type),
is_tail_call(is_tail_call), parameters(std::move(parameters)) {}

lldb::addr_t CallEdge::GetLoadAddress(lldb::addr_t unresolved_pc,
Function &caller, Target &target) {
Log *log = GetLog(LLDBLog::Step);
Expand Down Expand Up @@ -185,12 +192,30 @@ void DirectCallEdge::ParseSymbolFileAndResolve(ModuleList &images) {
resolved = true;
}

DirectCallEdge::DirectCallEdge(const char *symbol_name,
AddrType caller_address_type,
lldb::addr_t caller_address, bool is_tail_call,
CallSiteParameterArray &&parameters)
: CallEdge(caller_address_type, caller_address, is_tail_call,
std::move(parameters)) {
lazy_callee.symbol_name = symbol_name;
}

Function *DirectCallEdge::GetCallee(ModuleList &images, ExecutionContext &) {
ParseSymbolFileAndResolve(images);
assert(resolved && "Did not resolve lazy callee");
return lazy_callee.def;
}

IndirectCallEdge::IndirectCallEdge(DWARFExpressionList call_target,
AddrType caller_address_type,
lldb::addr_t caller_address,
bool is_tail_call,
CallSiteParameterArray &&parameters)
: CallEdge(caller_address_type, caller_address, is_tail_call,
std::move(parameters)),
call_target(std::move(call_target)) {}

Function *IndirectCallEdge::GetCallee(ModuleList &images,
ExecutionContext &exe_ctx) {
Log *log = GetLog(LLDBLog::Step);
Expand Down