Skip to content

Commit 0685cec

Browse files
committed
[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
1 parent 885c46e commit 0685cec

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,54 +1699,54 @@ bool SwiftLanguage::IsUninitializedReference(ValueObject &valobj) {
16991699
}
17001700

17011701
bool SwiftLanguage::GetFunctionDisplayName(
1702-
const SymbolContext *sc, const ExecutionContext *exe_ctx,
1702+
const SymbolContext &sc, const ExecutionContext *exe_ctx,
17031703
FunctionNameRepresentation representation, Stream &s) {
17041704
switch (representation) {
17051705
case Language::FunctionNameRepresentation::eName:
17061706
// No need to customize this.
17071707
return false;
17081708
case Language::FunctionNameRepresentation::eNameWithNoArgs: {
1709-
if (!sc->function)
1709+
if (!sc.function)
17101710
return false;
1711-
if (sc->function->GetLanguage() != eLanguageTypeSwift)
1711+
if (sc.function->GetLanguage() != eLanguageTypeSwift)
17121712
return false;
17131713
std::string display_name = SwiftLanguageRuntime::DemangleSymbolAsString(
1714-
sc->function->GetMangled().GetMangledName().GetStringRef(),
1715-
SwiftLanguageRuntime::eSimplified, sc, exe_ctx);
1714+
sc.function->GetMangled().GetMangledName().GetStringRef(),
1715+
SwiftLanguageRuntime::eSimplified, &sc, exe_ctx);
17161716
if (display_name.empty())
17171717
return false;
17181718
s << display_name;
17191719
return true;
17201720
}
17211721
case Language::FunctionNameRepresentation::eNameWithArgs: {
1722-
if (!sc->function)
1722+
if (!sc.function)
17231723
return false;
1724-
if (sc->function->GetLanguage() != eLanguageTypeSwift)
1724+
if (sc.function->GetLanguage() != eLanguageTypeSwift)
17251725
return false;
17261726
std::string display_name = SwiftLanguageRuntime::DemangleSymbolAsString(
1727-
sc->function->GetMangled().GetMangledName().GetStringRef(),
1728-
SwiftLanguageRuntime::eSimplified, sc, exe_ctx);
1727+
sc.function->GetMangled().GetMangledName().GetStringRef(),
1728+
SwiftLanguageRuntime::eSimplified, &sc, exe_ctx);
17291729
if (display_name.empty())
17301730
return false;
17311731
ExecutionContextScope *exe_scope =
17321732
exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL;
17331733
const InlineFunctionInfo *inline_info = NULL;
17341734
VariableListSP variable_list_sp;
17351735
bool get_function_vars = true;
1736-
if (sc->block) {
1737-
Block *inline_block = sc->block->GetContainingInlinedBlock();
1736+
if (sc.block) {
1737+
Block *inline_block = sc.block->GetContainingInlinedBlock();
17381738

17391739
if (inline_block) {
17401740
get_function_vars = false;
1741-
inline_info = sc->block->GetInlinedFunctionInfo();
1741+
inline_info = sc.block->GetInlinedFunctionInfo();
17421742
if (inline_info)
17431743
variable_list_sp = inline_block->GetBlockVariableList(true);
17441744
}
17451745
}
17461746

17471747
if (get_function_vars) {
17481748
variable_list_sp =
1749-
sc->function->GetBlock(true).GetBlockVariableList(true);
1749+
sc.function->GetBlock(true).GetBlockVariableList(true);
17501750
}
17511751

17521752
if (inline_info) {

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)