@@ -1186,6 +1186,40 @@ static bool PrintFunctionNameWithArgs(Stream &s,
1186
1186
return true ;
1187
1187
}
1188
1188
1189
+ static bool HandleFunctionNameWithArgs (Stream &s,const ExecutionContext *exe_ctx,
1190
+ const SymbolContext &sc) {
1191
+ Language *language_plugin = nullptr ;
1192
+ bool language_plugin_handled = false ;
1193
+ StreamString ss;
1194
+ if (sc.function )
1195
+ language_plugin = Language::FindPlugin (sc.function ->GetLanguage ());
1196
+ else if (sc.symbol )
1197
+ language_plugin = Language::FindPlugin (sc.symbol ->GetLanguage ());
1198
+
1199
+ if (language_plugin)
1200
+ language_plugin_handled = language_plugin->GetFunctionDisplayName (
1201
+ sc, exe_ctx, Language::FunctionNameRepresentation::eNameWithArgs, ss);
1202
+
1203
+ if (language_plugin_handled) {
1204
+ s << ss.GetString ();
1205
+ return true ;
1206
+ }
1207
+
1208
+ if (sc.function )
1209
+ return PrintFunctionNameWithArgs (s, exe_ctx, sc);
1210
+
1211
+ if (!sc.symbol )
1212
+ return false ;
1213
+
1214
+ const char *cstr = sc.symbol ->GetName ().AsCString (nullptr );
1215
+ if (!cstr)
1216
+ return false ;
1217
+
1218
+ s.PutCString (cstr);
1219
+
1220
+ return true ;
1221
+ }
1222
+
1189
1223
bool FormatEntity::FormatStringRef (const llvm::StringRef &format_str, Stream &s,
1190
1224
const SymbolContext *sc,
1191
1225
const ExecutionContext *exe_ctx,
@@ -1748,36 +1782,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
1748
1782
if (!sc)
1749
1783
return false ;
1750
1784
1751
- Language *language_plugin = nullptr ;
1752
- bool language_plugin_handled = false ;
1753
- StreamString ss;
1754
- if (sc->function )
1755
- language_plugin = Language::FindPlugin (sc->function ->GetLanguage ());
1756
- else if (sc->symbol )
1757
- language_plugin = Language::FindPlugin (sc->symbol ->GetLanguage ());
1758
-
1759
- if (language_plugin)
1760
- language_plugin_handled = language_plugin->GetFunctionDisplayName (
1761
- *sc, exe_ctx, Language::FunctionNameRepresentation::eNameWithArgs,
1762
- ss);
1763
-
1764
- if (language_plugin_handled) {
1765
- s << ss.GetString ();
1766
- return true ;
1767
- }
1768
-
1769
- if (sc->function )
1770
- return PrintFunctionNameWithArgs (s, exe_ctx, *sc);
1771
-
1772
- if (!sc->symbol )
1773
- return false ;
1774
-
1775
- const char *cstr = sc->symbol ->GetName ().AsCString (nullptr );
1776
- if (!cstr)
1777
- return false ;
1778
-
1779
- s.PutCString (cstr);
1780
- return true ;
1785
+ return HandleFunctionNameWithArgs (s, exe_ctx, *sc);
1781
1786
}
1782
1787
1783
1788
case Entry::Type::FunctionMangledName: {
0 commit comments