================
@@ -229,14 +230,38 @@ struct Entry {
bool deref = false;
};
-bool Format(const Entry &entry, Stream &s, const SymbolContext *sc,
- const ExecutionContext *exe_ctx, const Address *addr,
- ValueObject *valobj, bool function_changed, bool initial_function);
+class Formatter {
+public:
+ bool Format(const Entry &entry, Stream &s, const SymbolContext *sc,
+ const ExecutionContext *exe_ctx, const Address *addr,
+ ValueObject *valobj, bool function_changed,
+ bool initial_function);
----------------
JDevlieghere wrote:
I like the idea of making this a class. I think most of these arguments don't
change during the recursion, so we could move them into the constructor?
So then calls like this:
```
FormatEntity::Formatter().Format(*format, s, sc, exe_ctx, ...);
```
would become
```
FormatEntity::Formatter(sc_ctx, exe_ctx, ...).Format(*format, s);
```
https://github.com/llvm/llvm-project/pull/174618
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits