[PATCH] Introduce line editor library.

Peter Collingbourne peter at pcc.me.uk
Sun Nov 17 02:56:24 PST 2013


This library will be used by clang-query. I can imagine LLDB becoming another
client of this library, so I think LLVM is a sensible place for it to live.
It wraps libedit, and adds tab completion support.

The code is loosely based on the line editor bits in LLDB, with a few
improvements:

 - Polymorphism for retrieving the list of tab completions, based on
   the concept pattern from the new pass manager.

 - Tab completion doesn't corrupt terminal output if the input covers
   multiple lines. Unfortunately this can only be done in a truly horrible
   way, as far as I can tell. But since the alternative is to implement our
   own line editor (which I don't think LLVM should be in the business of
   doing, at least for now) I think it may be acceptable.

 - Includes a fallback for the case where the user doesn't have libedit
   installed.

Note that this uses C stdio, mainly because libedit also uses C stdio.

http://llvm-reviews.chandlerc.com/D2200

Files:
  autoconf/configure.ac
  cmake/config-ix.cmake
  configure
  include/llvm/Config/config.h.cmake
  include/llvm/Config/config.h.in
  include/llvm/LineEditor/LineEditor.h
  lib/CMakeLists.txt
  lib/LLVMBuild.txt
  lib/LineEditor/CMakeLists.txt
  lib/LineEditor/LLVMBuild.txt
  lib/LineEditor/LineEditor.cpp
  lib/LineEditor/Makefile
  unittests/Makefile
  lib/Makefile
  unittests/CMakeLists.txt
  unittests/LineEditor/CMakeLists.txt
  unittests/LineEditor/LineEditor.cpp
  unittests/LineEditor/Makefile
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2200.1.patch
Type: text/x-patch
Size: 30225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131117/8ae92be6/attachment.bin>


More information about the llvm-commits mailing list