Skip to content

Commit 0ed103b

Browse files
committed
Rename GetLanguageInfo to GetLanguageSpecificData (llvm#117012)
Unbeknownst to me the Swift LLDB branch already had an almost identical API with this name, so it makes sense to merge the two. (cherry picked from commit 8f8dced)
1 parent d5c33aa commit 0ed103b

File tree

9 files changed

+13
-22
lines changed

9 files changed

+13
-22
lines changed

lldb/include/lldb/API/SBFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class LLDB_API SBFrame {
130130
/// Language plugins can use this API to report language-specific
131131
/// runtime information about this compile unit, such as additional
132132
/// language version details or feature flags.
133-
SBStructuredData GetLanguageInfo();
133+
SBStructuredData GetLanguageSpecificData();
134134

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

lldb/include/lldb/Target/LanguageRuntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class LanguageRuntime : public Runtime, public PluginInterface {
288288
/// Language runtime plugins can use this API to report
289289
/// language-specific runtime information about this compile unit,
290290
/// such as additional language version details or feature flags.
291-
virtual StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc);
291+
virtual StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc);
292292

293293
protected:
294294
// The static GetRuntimeUnwindPlan method above is only implemented in the

lldb/include/lldb/Target/StackFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class StackFrame : public ExecutionContextScope,
420420
/// Language plugins can use this API to report language-specific
421421
/// runtime information about this compile unit, such as additional
422422
/// language version details or feature flags.
423-
StructuredData::ObjectSP GetLanguageInfo();
423+
StructuredData::ObjectSP GetLanguageSpecificData();
424424

425425
/// Get the frame's demangled name.
426426
///

lldb/source/API/SBFrame.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
11561156
return expr_result;
11571157
}
11581158

1159-
SBStructuredData SBFrame::GetLanguageInfo() {
1159+
SBStructuredData SBFrame::GetLanguageSpecificData() {
11601160
LLDB_INSTRUMENT_VA(this);
11611161

11621162
SBStructuredData sb_data;
@@ -1166,7 +1166,7 @@ SBStructuredData SBFrame::GetLanguageInfo() {
11661166
if (!frame)
11671167
return sb_data;
11681168

1169-
StructuredData::ObjectSP data(frame->GetLanguageInfo());
1169+
StructuredData::ObjectSP data(frame->GetLanguageSpecificData());
11701170
sb_data.m_impl_up->SetObjectSP(data);
11711171
return sb_data;
11721172
}
@@ -1254,17 +1254,6 @@ lldb::LanguageType SBFrame::GuessLanguage() const {
12541254
return eLanguageTypeUnknown;
12551255
}
12561256

1257-
lldb::SBStructuredData SBFrame::GetLanguageSpecificData() const {
1258-
std::unique_lock<std::recursive_mutex> lock;
1259-
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1260-
auto *frame = exe_ctx.GetFramePtr();
1261-
if (frame)
1262-
if (StructuredDataImpl *data = frame->GetLanguageSpecificData())
1263-
return SBStructuredData(*data);
1264-
1265-
return {};
1266-
}
1267-
12681257
// BEGIN SWIFT
12691258
bool SBFrame::IsSwiftThunk() const {
12701259
std::unique_lock<std::recursive_mutex> lock;

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,8 @@ std::optional<uint64_t> AppleObjCRuntimeV2::GetSharedCacheImageHeaderVersion() {
34113411
return std::nullopt;
34123412
}
34133413

3414-
StructuredData::ObjectSP AppleObjCRuntimeV2::GetLanguageInfo(SymbolContext sc) {
3414+
StructuredData::ObjectSP
3415+
AppleObjCRuntimeV2::GetLanguageSpecificData(SymbolContext sc) {
34153416
auto dict_up = std::make_unique<StructuredData::Dictionary>();
34163417
dict_up->AddItem("Objective-C runtime version",
34173418
std::make_unique<StructuredData::UnsignedInteger>(2));

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime {
106106

107107
std::optional<uint64_t> GetSharedCacheImageHeaderVersion();
108108

109-
StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc) override;
109+
StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc) override;
110110

111111
protected:
112112
lldb::BreakpointResolverSP

lldb/source/Target/LanguageRuntime.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ LanguageRuntime::GetRuntimeUnwindPlan(Thread &thread, RegisterContext *regctx,
277277
return UnwindPlanSP();
278278
}
279279

280-
StructuredData::ObjectSP LanguageRuntime::GetLanguageInfo(SymbolContext sc) {
280+
StructuredData::ObjectSP
281+
LanguageRuntime::GetLanguageSpecificData(SymbolContext sc) {
281282
return {};
282283
}
283284

lldb/source/Target/StackFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,14 +1238,14 @@ bool StackFrame::IsSwiftThunk() {
12381238
return runtime->IsSymbolARuntimeThunk(*sc.symbol);
12391239
}
12401240

1241-
StructuredData::ObjectSP StackFrame::GetLanguageInfo() {
1241+
StructuredData::ObjectSP StackFrame::GetLanguageSpecificData() {
12421242
auto process_sp = CalculateProcess();
12431243
SourceLanguage language = GetLanguage();
12441244
if (!language)
12451245
return {};
12461246
if (auto runtime_sp =
12471247
process_sp->GetLanguageRuntime(language.AsLanguageType()))
1248-
return runtime_sp->GetLanguageInfo(
1248+
return runtime_sp->GetLanguageSpecificData(
12491249
GetSymbolContext(eSymbolContextFunction));
12501250
return {};
12511251
}

lldb/test/API/lang/objc/languageinfo/TestObjCLanguageInfo.py renamed to lldb/test/API/lang/objc/languageinfo/TestObjCLanguageSpecificData.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def test_imp_ivar_type(self):
1111
self.build()
1212
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(self, "main")
1313
frame = thread.GetFrameAtIndex(0)
14-
lang_info = frame.GetLanguageInfo()
14+
lang_info = frame.GetLanguageSpecificData()
1515
version = lang_info.GetValueForKey("Objective-C runtime version")
1616
self.assertEqual(version.GetIntegerValue(), 2)

0 commit comments

Comments
 (0)