Go to file
Pavel Labath 5f56fca4e1 Move option parsing out of the Args class
Summary:
The args class is used in plenty of places (a lot of them in the lower lldb
layers) for representing a list of arguments, and most of these places don't
care about option parsing. Moving the option parsing out of the class removes
the largest external dependency (there are a couple more, but these are in
static functions), and brings us closer to being able to move it to the
Utility module).

The new home for these functions is the Options class, which was already used
as an argument to the parse calls, so this just inverts the dependency between
the two.

The functions are themselves are mainly just copied -- the biggest functional
change I've made to them is to avoid modifying the input Args argument (getopt
likes to permute the argument vector), as it was weird to have another class
reorder the entries in Args class. So now the functions don't modify the input
arguments, and (for those where it makes sense) return a new Args vector
instead. I've also made the addition of a "fake arg0" (required for getopt
compatibility) an implementation detail rather than a part of interface.

While doing that I noticed that ParseForCompletion function was recording the
option indexes in the shuffled vector, but then the consumer was looking up the
entries in the unshuffled one. This manifested itself as us not being able to
complete "watchpoint set variable foo --" (because getopt would move "foo" to
the end). Surprisingly all other completions (e.g. "watchpoint set variable foo
--w") were not affected by this. However, I couldn't find a comprehensive test
for command argument completion, so I consolidated the existing tests and added
a bunch of new ones.

Reviewers: davide, jingham, zturner

Subscribers: lldb-commits

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

llvm-svn: 327110
2018-03-09 10:39:40 +00:00
clang CodeGen: simplify and validate exception personalities 2018-03-09 07:06:42 +00:00
clang-tools-extra Revert "[clang-doc] Setup clang-doc frontend framework" 2018-03-09 03:47:18 +00:00
compiler-rt Mark the -overlap tests are "UNSUPPORTED: android". Android test harness doesn't know how to handle suppression files. 2018-03-09 00:41:29 +00:00
debuginfo-tests [Darwin] Specify DWARF 2/4 when running apple accelerator tests. 2018-02-26 20:56:45 +00:00
libclc amdgcn/fmax: fcanonicalize operands 2018-03-08 23:01:01 +00:00
libcxx Low-hanging fruit optimization in string::__move_assign(). 2018-03-08 21:15:26 +00:00
libcxxabi [demangler] Fix a mistake in r326797. 2018-03-07 04:29:33 +00:00
libunwind [libunwind][MIPS]: Add support for unwinding in N32 processes. 2018-02-27 21:24:02 +00:00
lld Resubmit "Write a hash of the executable into the PE timestamp fields." 2018-03-08 19:33:47 +00:00
lldb Move option parsing out of the Args class 2018-03-09 10:39:40 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [LV] Fix vectorizer's isUniform() abuse triggers assert in SCEV 2018-03-09 10:31:31 +00:00
openmp [OpenMP][libomptarget] Fix union. 2018-03-08 18:44:02 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [Polly][CMake] Fix lit setup for building the in the mono repo 2018-03-05 14:43:04 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.