[Lldb-commits] [PATCH] D49963: Preliminary patch to support prompt interpolation
Neal via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 3 13:47:55 PDT 2018
nealsid accepted this revision.
nealsid added inline comments.
This revision is now accepted and ready to land.
================
Comment at: include/lldb/Host/Editline.h:187
+ /// Register a callback to retrieve the prompt.
+ void SetPromptCallback(PromptCallbackType callback, void *baton);
+
----------------
zturner wrote:
> I'd love to stop using the `baton` idiom if possible. can you make this function take an `llvm::function_ref<StringRef (EditLine*)>` instead? Then, in the class, store a `std::function<StringRef (EditLine*)>`. When you call `SetPromptCallback`, write `SetPromptCallback([this](EditLine* L) { return this->PromptCallback(L); });`
Sounds good to me. I'll split up the changes and sent a patch that migrates to std::function & removes baton from all callbacks in Editline first and then rebase this one on top of that.
Repository:
rL LLVM
https://reviews.llvm.org/D49963
More information about the lldb-commits
mailing list