Convert option tables to ArrayRefs.
authorZachary Turner <zturner@google.com>
Thu, 22 Sep 2016 20:22:55 +0000 (20:22 +0000)
committerZachary Turner <zturner@google.com>
Thu, 22 Sep 2016 20:22:55 +0000 (20:22 +0000)
commit1f0f5b5b9eeaea93126583b40070091baf3bc92d
tree93be6068ce5a7314fb9bfdf0621f65c03b3cad0b
parent387eb83a509926ed6bd36591d1f235335ec215c0
Convert option tables to ArrayRefs.

This change is very mechanical.  All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`.  In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface.  These are no longer necessary as
`ArrayRef` carries its own length.

In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length.  Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class.  This
results in this CL looking very big, but in terms of substance
there is not much here.

Differential revision: https://reviews.llvm.org/D24834

llvm-svn: 282188
54 files changed:
lldb/include/lldb/Interpreter/OptionGroupArchitecture.h
lldb/include/lldb/Interpreter/OptionGroupBoolean.h
lldb/include/lldb/Interpreter/OptionGroupFile.h
lldb/include/lldb/Interpreter/OptionGroupFormat.h
lldb/include/lldb/Interpreter/OptionGroupOutputFile.h
lldb/include/lldb/Interpreter/OptionGroupPlatform.h
lldb/include/lldb/Interpreter/OptionGroupString.h
lldb/include/lldb/Interpreter/OptionGroupUInt64.h
lldb/include/lldb/Interpreter/OptionGroupUUID.h
lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
lldb/include/lldb/Interpreter/OptionGroupVariable.h
lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h
lldb/include/lldb/Interpreter/Options.h
lldb/include/lldb/Target/Platform.h
lldb/include/lldb/Target/Process.h
lldb/source/Commands/CommandObjectArgs.cpp
lldb/source/Commands/CommandObjectArgs.h
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Commands/CommandObjectDisassemble.cpp
lldb/source/Commands/CommandObjectDisassemble.h
lldb/source/Commands/CommandObjectExpression.cpp
lldb/source/Commands/CommandObjectExpression.h
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectHelp.cpp
lldb/source/Commands/CommandObjectHelp.h
lldb/source/Commands/CommandObjectLog.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Commands/CommandObjectPlatform.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandObjectRegister.cpp
lldb/source/Commands/CommandObjectSettings.cpp
lldb/source/Commands/CommandObjectSource.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Commands/CommandObjectWatchpoint.cpp
lldb/source/Commands/CommandObjectWatchpointCommand.cpp
lldb/source/Interpreter/Args.cpp
lldb/source/Interpreter/OptionGroupArchitecture.cpp
lldb/source/Interpreter/OptionGroupFormat.cpp
lldb/source/Interpreter/OptionGroupOutputFile.cpp
lldb/source/Interpreter/OptionGroupPlatform.cpp
lldb/source/Interpreter/OptionGroupUUID.cpp
lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
lldb/source/Interpreter/OptionGroupVariable.cpp
lldb/source/Interpreter/OptionGroupWatchpoint.cpp
lldb/source/Interpreter/Options.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/source/Target/Platform.cpp
lldb/source/Target/Process.cpp