Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ static ConstString GetSwiftDemangledStr(ConstString m_mangled,
164
164
std::max (info.BasenameRange .second , info.ArgumentsRange .second );
165
165
info.SuffixRange .second = demangled.length ();
166
166
167
- // Don't cache the demangled name the function isn't available yet.
167
+ // Don't cache the demangled name if the function isn't available yet.
168
168
if (!sc || !sc->function ) {
169
169
LLDB_LOGF (log, " demangle swift: %s -> \" %s\" (not cached)" , mangled_name,
170
170
demangled.c_str ());
Original file line number Diff line number Diff line change 18
18
19
19
using namespace swift ::Demangle;
20
20
21
+ // / A NodePrinter class with range tracking capabilities.
22
+ // /
23
+ // / When used instead of a regular NodePrinter, this class will store additional
24
+ // / range information of the demangled name in the `info` attribute, such as the
25
+ // / range of the name of a method.
21
26
class TrackingNodePrinter : public NodePrinter {
22
27
public:
23
28
TrackingNodePrinter (DemangleOptions options) : NodePrinter(options) {}
Original file line number Diff line number Diff line change @@ -201,11 +201,27 @@ class SwiftLanguageRuntime : public LanguageRuntime {
201
201
202
202
enum DemangleMode { eSimplified, eTypeName, eDisplayTypeName };
203
203
204
+ // / Demangle a symbol to a string.
205
+ // /
206
+ // / \param symbol The mangled symbol to demangle.
207
+ // / \param mode The `DemangleMode` to use when demangling.
208
+ // / \param sc The associated `SymbolContext`.
209
+ // / \param exe_ctx The associated `ExecutionContext`.
210
+ // /
211
+ // / \return The demangled symbol.
204
212
static std::string
205
213
DemangleSymbolAsString (llvm::StringRef symbol, DemangleMode mode,
206
214
const SymbolContext *sc = nullptr ,
207
215
const ExecutionContext *exe_ctx = nullptr );
208
216
217
+ // / Demangle a symbol to a string with additional range information.
218
+ // /
219
+ // / \param symbol The mangled symbol to demangle.
220
+ // / \param mode The `DemangleMode` to use when demangling.
221
+ // / \param sc The associated `SymbolContext`.
222
+ // / \param exe_ctx The associated `ExecutionContext`.
223
+ // /
224
+ // / \return The demangled symbol as well as range tracking information.
209
225
static std::pair<std::string, DemangledNameInfo>
210
226
TrackedDemangleSymbolAsString (llvm::StringRef symbol, DemangleMode mode,
211
227
const SymbolContext *sc = nullptr ,
0 commit comments