-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Rename GetLanguageInfo to GetLanguageSpecificData #117012
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unbeknownst to me the Swift LLDB branch already had an almost identical API with this name, so it makes sense to merge the two.
@llvm/pr-subscribers-lldb Author: Adrian Prantl (adrian-prantl) ChangesUnbeknownst to me the Swift LLDB branch already had an almost identical API with this name, so it makes sense to merge the two. Full diff: https://github.com/llvm/llvm-project/pull/117012.diff 9 Files Affected:
diff --git a/lldb/include/lldb/API/SBFrame.h b/lldb/include/lldb/API/SBFrame.h
index e1ff217767cb98..629d4e5bc61f46 100644
--- a/lldb/include/lldb/API/SBFrame.h
+++ b/lldb/include/lldb/API/SBFrame.h
@@ -125,7 +125,7 @@ class LLDB_API SBFrame {
/// Language plugins can use this API to report language-specific
/// runtime information about this compile unit, such as additional
/// language version details or feature flags.
- SBStructuredData GetLanguageInfo();
+ SBStructuredData GetLanguageSpecificData();
/// Gets the lexical block that defines the stack frame. Another way to think
/// of this is it will return the block that contains all of the variables
diff --git a/lldb/include/lldb/Target/LanguageRuntime.h b/lldb/include/lldb/Target/LanguageRuntime.h
index 4f4d426eaa1dab..4a0214b04e235e 100644
--- a/lldb/include/lldb/Target/LanguageRuntime.h
+++ b/lldb/include/lldb/Target/LanguageRuntime.h
@@ -244,7 +244,7 @@ class LanguageRuntime : public Runtime, public PluginInterface {
/// Language runtime plugins can use this API to report
/// language-specific runtime information about this compile unit,
/// such as additional language version details or feature flags.
- virtual StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc);
+ virtual StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc);
protected:
// The static GetRuntimeUnwindPlan method above is only implemented in the
diff --git a/lldb/include/lldb/Target/StackFrame.h b/lldb/include/lldb/Target/StackFrame.h
index 5e82657706339c..3f51c9a7f22f09 100644
--- a/lldb/include/lldb/Target/StackFrame.h
+++ b/lldb/include/lldb/Target/StackFrame.h
@@ -412,7 +412,7 @@ class StackFrame : public ExecutionContextScope,
/// Language plugins can use this API to report language-specific
/// runtime information about this compile unit, such as additional
/// language version details or feature flags.
- StructuredData::ObjectSP GetLanguageInfo();
+ StructuredData::ObjectSP GetLanguageSpecificData();
/// Get the frame's demangled name.
///
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index d17bb5cc146086..5c735dd35e1cf3 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -1155,7 +1155,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
return expr_result;
}
-SBStructuredData SBFrame::GetLanguageInfo() {
+SBStructuredData SBFrame::GetLanguageSpecificData() {
LLDB_INSTRUMENT_VA(this);
SBStructuredData sb_data;
@@ -1165,7 +1165,7 @@ SBStructuredData SBFrame::GetLanguageInfo() {
if (!frame)
return sb_data;
- StructuredData::ObjectSP data(frame->GetLanguageInfo());
+ StructuredData::ObjectSP data(frame->GetLanguageSpecificData());
sb_data.m_impl_up->SetObjectSP(data);
return sb_data;
}
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 7298ab0e7336bf..0083b499656979 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -3398,7 +3398,8 @@ std::optional<uint64_t> AppleObjCRuntimeV2::GetSharedCacheImageHeaderVersion() {
return std::nullopt;
}
-StructuredData::ObjectSP AppleObjCRuntimeV2::GetLanguageInfo(SymbolContext sc) {
+StructuredData::ObjectSP
+AppleObjCRuntimeV2::GetLanguageSpecificData(SymbolContext sc) {
auto dict_up = std::make_unique<StructuredData::Dictionary>();
dict_up->AddItem("Objective-C runtime version",
std::make_unique<StructuredData::UnsignedInteger>(2));
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index 7117b778a1c0e9..2422539b13f13d 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -106,7 +106,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime {
std::optional<uint64_t> GetSharedCacheImageHeaderVersion();
- StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc) override;
+ StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc) override;
protected:
lldb::BreakpointResolverSP
diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp
index 89bad75995ff14..269d1e017fdf24 100644
--- a/lldb/source/Target/LanguageRuntime.cpp
+++ b/lldb/source/Target/LanguageRuntime.cpp
@@ -277,7 +277,8 @@ LanguageRuntime::GetRuntimeUnwindPlan(Thread &thread, RegisterContext *regctx,
return UnwindPlanSP();
}
-StructuredData::ObjectSP LanguageRuntime::GetLanguageInfo(SymbolContext sc) {
+StructuredData::ObjectSP
+LanguageRuntime::GetLanguageSpecificData(SymbolContext sc) {
return {};
}
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index e7d3b883bdec56..dfbac5a572d00a 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1231,14 +1231,14 @@ bool StackFrame::IsHidden() {
return false;
}
-StructuredData::ObjectSP StackFrame::GetLanguageInfo() {
+StructuredData::ObjectSP StackFrame::GetLanguageSpecificData() {
auto process_sp = CalculateProcess();
SourceLanguage language = GetLanguage();
if (!language)
return {};
if (auto runtime_sp =
process_sp->GetLanguageRuntime(language.AsLanguageType()))
- return runtime_sp->GetLanguageInfo(
+ return runtime_sp->GetLanguageSpecificData(
GetSymbolContext(eSymbolContextFunction));
return {};
}
diff --git a/lldb/test/API/lang/objc/languageinfo/TestObjCLanguageInfo.py b/lldb/test/API/lang/objc/languageinfo/TestObjCLanguageSpecificData.py
similarity index 90%
rename from lldb/test/API/lang/objc/languageinfo/TestObjCLanguageInfo.py
rename to lldb/test/API/lang/objc/languageinfo/TestObjCLanguageSpecificData.py
index 18e04c9e8bac50..5558abed929dac 100644
--- a/lldb/test/API/lang/objc/languageinfo/TestObjCLanguageInfo.py
+++ b/lldb/test/API/lang/objc/languageinfo/TestObjCLanguageSpecificData.py
@@ -11,6 +11,6 @@ def test_imp_ivar_type(self):
self.build()
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(self, "main")
frame = thread.GetFrameAtIndex(0)
- lang_info = frame.GetLanguageInfo()
+ lang_info = frame.GetLanguageSpecificData()
version = lang_info.GetValueForKey("Objective-C runtime version")
self.assertEqual(version.GetIntegerValue(), 2)
|
JDevlieghere
approved these changes
Nov 20, 2024
adrian-prantl
added a commit
to adrian-prantl/llvm-project
that referenced
this pull request
Nov 20, 2024
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)
adrian-prantl
added a commit
to adrian-prantl/llvm-project
that referenced
this pull request
Nov 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unbeknownst to me the Swift LLDB branch already had an almost identical API with this name, so it makes sense to merge the two.