Skip to content

Commit 8f8dced

Browse files
Rename GetLanguageInfo to GetLanguageSpecificData (#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.
1 parent 7404685 commit 8f8dced

File tree

9 files changed

+13
-11
lines changed

9 files changed

+13
-11
lines changed

lldb/include/lldb/API/SBFrame.h

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

130130
/// Gets the lexical block that defines the stack frame. Another way to think
131131
/// 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
@@ -244,7 +244,7 @@ class LanguageRuntime : public Runtime, public PluginInterface {
244244
/// Language runtime plugins can use this API to report
245245
/// language-specific runtime information about this compile unit,
246246
/// such as additional language version details or feature flags.
247-
virtual StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc);
247+
virtual StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc);
248248

249249
protected:
250250
// 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
@@ -412,7 +412,7 @@ class StackFrame : public ExecutionContextScope,
412412
/// Language plugins can use this API to report language-specific
413413
/// runtime information about this compile unit, such as additional
414414
/// language version details or feature flags.
415-
StructuredData::ObjectSP GetLanguageInfo();
415+
StructuredData::ObjectSP GetLanguageSpecificData();
416416

417417
/// Get the frame's demangled name.
418418
///

lldb/source/API/SBFrame.cpp

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

1158-
SBStructuredData SBFrame::GetLanguageInfo() {
1158+
SBStructuredData SBFrame::GetLanguageSpecificData() {
11591159
LLDB_INSTRUMENT_VA(this);
11601160

11611161
SBStructuredData sb_data;
@@ -1165,7 +1165,7 @@ SBStructuredData SBFrame::GetLanguageInfo() {
11651165
if (!frame)
11661166
return sb_data;
11671167

1168-
StructuredData::ObjectSP data(frame->GetLanguageInfo());
1168+
StructuredData::ObjectSP data(frame->GetLanguageSpecificData());
11691169
sb_data.m_impl_up->SetObjectSP(data);
11701170
return sb_data;
11711171
}

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

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

3401-
StructuredData::ObjectSP AppleObjCRuntimeV2::GetLanguageInfo(SymbolContext sc) {
3401+
StructuredData::ObjectSP
3402+
AppleObjCRuntimeV2::GetLanguageSpecificData(SymbolContext sc) {
34023403
auto dict_up = std::make_unique<StructuredData::Dictionary>();
34033404
dict_up->AddItem("Objective-C runtime version",
34043405
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
@@ -1231,14 +1231,14 @@ bool StackFrame::IsHidden() {
12311231
return false;
12321232
}
12331233

1234-
StructuredData::ObjectSP StackFrame::GetLanguageInfo() {
1234+
StructuredData::ObjectSP StackFrame::GetLanguageSpecificData() {
12351235
auto process_sp = CalculateProcess();
12361236
SourceLanguage language = GetLanguage();
12371237
if (!language)
12381238
return {};
12391239
if (auto runtime_sp =
12401240
process_sp->GetLanguageRuntime(language.AsLanguageType()))
1241-
return runtime_sp->GetLanguageInfo(
1241+
return runtime_sp->GetLanguageSpecificData(
12421242
GetSymbolContext(eSymbolContextFunction));
12431243
return {};
12441244
}

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)