Skip to content

Commit d8b25be

Browse files
Michael137AnthonyLatsis
authored andcommitted
[lldb][Swift][NFC] Adjust GetFunctionDisplayName to take SymbolContext by reference
The API was changed upstream for the C++ plugin. This patch adjusts the API implementation for Swift (cherry picked from commit 0685cec)
1 parent 571b63a commit d8b25be

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,20 +1717,20 @@ bool SwiftLanguage::IsUninitializedReference(ValueObject &valobj) {
17171717
}
17181718

17191719
bool SwiftLanguage::GetFunctionDisplayName(
1720-
const SymbolContext *sc, const ExecutionContext *exe_ctx,
1720+
const SymbolContext &sc, const ExecutionContext *exe_ctx,
17211721
FunctionNameRepresentation representation, Stream &s) {
17221722
switch (representation) {
17231723
case Language::FunctionNameRepresentation::eName:
17241724
// No need to customize this.
17251725
return false;
17261726
case Language::FunctionNameRepresentation::eNameWithNoArgs: {
1727-
if (!sc->function)
1727+
if (!sc.function)
17281728
return false;
1729-
if (sc->function->GetLanguage() != eLanguageTypeSwift)
1729+
if (sc.function->GetLanguage() != eLanguageTypeSwift)
17301730
return false;
17311731
std::string display_name = SwiftLanguageRuntime::DemangleSymbolAsString(
1732-
sc->function->GetMangled().GetMangledName().GetStringRef(),
1733-
SwiftLanguageRuntime::eSimplified, sc, exe_ctx);
1732+
sc.function->GetMangled().GetMangledName().GetStringRef(),
1733+
SwiftLanguageRuntime::eSimplified, &sc, exe_ctx);
17341734
if (display_name.empty())
17351735
return false;
17361736
s << display_name;
@@ -1744,20 +1744,20 @@ bool SwiftLanguage::GetFunctionDisplayName(
17441744
const InlineFunctionInfo *inline_info = NULL;
17451745
VariableListSP variable_list_sp;
17461746
bool get_function_vars = true;
1747-
if (sc->block) {
1748-
Block *inline_block = sc->block->GetContainingInlinedBlock();
1747+
if (sc.block) {
1748+
Block *inline_block = sc.block->GetContainingInlinedBlock();
17491749

17501750
if (inline_block) {
17511751
get_function_vars = false;
1752-
inline_info = sc->block->GetInlinedFunctionInfo();
1752+
inline_info = sc.block->GetInlinedFunctionInfo();
17531753
if (inline_info)
17541754
variable_list_sp = inline_block->GetBlockVariableList(true);
17551755
}
17561756
}
17571757

17581758
if (get_function_vars) {
17591759
variable_list_sp =
1760-
sc->function->GetBlock(true).GetBlockVariableList(true);
1760+
sc.function->GetBlock(true).GetBlockVariableList(true);
17611761
}
17621762

17631763
VariableList args;

lldb/source/Plugins/Language/Swift/SwiftLanguage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class SwiftLanguage : public Language {
6464

6565
bool IsUninitializedReference(ValueObject &valobj) override;
6666

67-
bool GetFunctionDisplayName(const SymbolContext *sc,
67+
bool GetFunctionDisplayName(const SymbolContext &sc,
6868
const ExecutionContext *exe_ctx,
6969
FunctionNameRepresentation representation,
7070
Stream &s) override;

0 commit comments

Comments
 (0)