[all-commits] [llvm/llvm-project] fd89af: Wrap edit line configuration calls into helper fun...

Neal via All-commits all-commits at lists.llvm.org
Fri Apr 30 03:33:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd89af6880f33ead708abe2f7d88ecb687d4e0d2
      https://github.com/llvm/llvm-project/commit/fd89af6880f33ead708abe2f7d88ecb687d4e0d2
  Author: Neal (nealsid) <nealsid at icloud.com>
  Date:   2021-04-30 (Fri, 30 Apr 2021)

  Changed paths:
    M lldb/include/lldb/Host/Editline.h
    M lldb/source/Host/common/Editline.cpp

  Log Message:
  -----------
  Wrap edit line configuration calls into helper functions

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.

Reviewed By: teemperor, JDevlieghere

Differential Revision: https://reviews.llvm.org/D101250




More information about the All-commits mailing list