[Lldb-commits] [PATCH] D101250: Wrap edit line configuration calls into helper functions

Neal via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 25 01:25:37 PDT 2021


nealsid created this revision.
nealsid requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Currently we call el_set directly to configure the editor in the libedit wrapper.  There are some cases in which this causes extra casting, but we pass captureless lambdas as function pointers, which should work out of the box.  Since el_set takes varargs, if the cast is incorrect or if the cast is not present, it causes a run time failure rather than compile error.  This change makes it so a few different types of configuration is done inside a helper function to provide type safety and eliminate that casting.  I didn't do all edit line configuration because I'm not sure how important it was in other cases and it might require something more general keep up with libedit's signature.  I'm open to suggestions, though.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101250

Files:
  lldb/include/lldb/Host/Editline.h
  lldb/source/Host/common/Editline.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101250.340339.patch
Type: text/x-patch
Size: 12167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210425/420f071c/attachment.bin>


More information about the lldb-commits mailing list