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