Skip to content

Commit 0954afb

Browse files
committed
Make SBFrame::GetLanguageSpecificData() const (llvm#117019)
One last diff I missed between Swift and LLVM. (cherry picked from commit 6473a36) (cherry picked from commit a3bdac9)
1 parent 9fbfe66 commit 0954afb

File tree

5 files changed

+7
-28
lines changed

5 files changed

+7
-28
lines changed

lldb/include/lldb/API/SBFrame.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ class LLDB_API SBFrame {
9696
LLDB_DEPRECATED("Use SBFrame::IsHidden() instead.")
9797
bool IsSwiftThunk() const;
9898

99-
lldb::SBStructuredData GetLanguageSpecificData() const;
100-
10199
/// Return true if this frame represents an inlined function.
102100
///
103101
/// See also GetFunctionName().
@@ -130,7 +128,7 @@ class LLDB_API SBFrame {
130128
/// Language plugins can use this API to report language-specific
131129
/// runtime information about this compile unit, such as additional
132130
/// language version details or feature flags.
133-
SBStructuredData GetLanguageSpecificData();
131+
SBStructuredData GetLanguageSpecificData() const;
134132

135133
/// Gets the lexical block that defines the stack frame. Another way to think
136134
/// of this is it will return the block that contains all of the variables

lldb/include/lldb/Target/LanguageRuntime.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,22 +230,6 @@ class LanguageRuntime : public Runtime, public PluginInterface {
230230
virtual bool isA(const void *ClassID) const { return ClassID == &ID; }
231231
static char ID;
232232

233-
/// Query the runtime for language specific metadata about the given frame.
234-
///
235-
/// Properties that are common to all languages are exposed as dedicated APIs
236-
/// of \c Frame and \c Function. This function complements those APIs by
237-
/// producing a \c StructuredData instance that encapsulates non-common
238-
/// properties about the frame and function.
239-
///
240-
/// \param[in] frame
241-
/// The frame to compute metadata for.
242-
///
243-
/// \return
244-
/// Returns a StructuredData containing the metadata.
245-
virtual StructuredDataImpl *GetLanguageSpecificData(StackFrame &frame) {
246-
return nullptr;
247-
}
248-
249233
virtual void FindFunctionPointersInCall(StackFrame &frame,
250234
std::vector<Address> &addresses,
251235
bool debug_only = true,

lldb/source/API/SBFrame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
11631163
return expr_result;
11641164
}
11651165

1166-
SBStructuredData SBFrame::GetLanguageSpecificData() {
1166+
SBStructuredData SBFrame::GetLanguageSpecificData() const {
11671167
LLDB_INSTRUMENT_VA(this);
11681168

11691169
SBStructuredData sb_data;

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,20 +1179,17 @@ SwiftLanguageRuntimeImpl::GetObjectDescription(Stream &str,
11791179
return RunObjectDescriptionExpr(object, expr_string, str);
11801180
}
11811181

1182-
StructuredDataImpl *
1183-
SwiftLanguageRuntime::GetLanguageSpecificData(StackFrame &frame) {
1184-
auto sc = frame.GetSymbolContext(eSymbolContextFunction);
1182+
StructuredData::ObjectSP
1183+
SwiftLanguageRuntime::GetLanguageSpecificData(SymbolContext sc) {
11851184
if (!sc.function)
1186-
return nullptr;
1185+
return {};
11871186

11881187
auto dict_sp = std::make_shared<StructuredData::Dictionary>();
11891188
auto symbol = sc.function->GetMangled().GetMangledName().GetStringRef();
11901189
auto is_async = SwiftLanguageRuntime::IsAnySwiftAsyncFunctionSymbol(symbol);
11911190
dict_sp->AddBooleanItem("IsSwiftAsyncFunction", is_async);
11921191

1193-
auto *data = new StructuredDataImpl;
1194-
data->SetObjectSP(dict_sp);
1195-
return data;
1192+
return dict_sp;
11961193
}
11971194

11981195
void SwiftLanguageRuntime::FindFunctionPointersInCall(

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ class SwiftLanguageRuntime : public LanguageRuntime {
431431
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
432432
bool stop_others) override;
433433

434-
StructuredDataImpl *GetLanguageSpecificData(StackFrame &frame) override;
434+
StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc) override;
435435

436436
/// If you are at the initial instruction of the frame passed in,
437437
/// then this will examine the call arguments, and if any of them is

0 commit comments

Comments
 (0)