Fix tests broken by the OptionValidator changes.
authorZachary Turner <zturner@google.com>
Wed, 9 Jul 2014 16:32:07 +0000 (16:32 +0000)
committerZachary Turner <zturner@google.com>
Wed, 9 Jul 2014 16:32:07 +0000 (16:32 +0000)
commitdf734cdd39cd3ad90f4f4466ddb497ffc14c1258
tree30a2656ef6dced5edac95193d95ec1c200c7c126
parentd37221dc5d819d63dbe35ab9a2d60e73cbd52dbd
Fix tests broken by the OptionValidator changes.

The getopt library has a structure called option (lowercase).  We
have a structure called Option (uppercase).  previously the two
structures had exactly the same definitions, and we were doing a
C-style cast of an Option* to an option*.  C-style casts don't
bother to warn you when you cast to unrelated types, but in the
original OptionValidator patch I modified the definition of Option.

This patch fixes the errors by building an array of option
structures and filling it out the correct way before passing it to
the getopt library.

This also fixes one other source of test failures: an uninitialized
read that occurs due to not initializing a field of the
OptionDefinition.

Reviewed By: Todd Fiala

Differential Revision: http://reviews.llvm.org/D4425

llvm-svn: 212628
lldb/source/Host/common/OptionParser.cpp
lldb/source/Interpreter/OptionGroupBoolean.cpp
lldb/source/Interpreter/OptionGroupFile.cpp
lldb/source/Interpreter/OptionGroupString.cpp
lldb/source/Interpreter/OptionGroupUInt64.cpp