[PATCH] Refactoring llvm command line parsing and option registration.

Chris Bieneman beanz at apple.com
Thu Jan 22 14:29:28 PST 2015


Hi dexonsmith, chandlerc,

The primary goal of this patch is to remove the need for MarkOptionsChanged(). That goal is accomplished by having addOption and removeOption properly sort the options.

This patch puts the new add and remove functionality on a CommandLineParser class that is a placeholder. Some of the functionality in this class will need to be merged into the OptionRegistry, and other bits can hopefully be in a better abstraction.

This patch also removes the RegisteredOptionList global, and the need for cl::Option objects to be linked list nodes.

The changes in CommandLineTest.cpp are required because these changes shift when we validate that options are not duplicated. Before this change duplicate options were only found during certain cl API calls (like cl::ParseCommandLine). With this change duplicate options are found during option construction.

http://reviews.llvm.org/D7132

Files:
  include/llvm/Support/CommandLine.h
  lib/Support/CommandLine.cpp
  unittests/Support/CommandLineTest.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7132.18639.patch
Type: text/x-patch
Size: 22717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150122/3686278c/attachment.bin>


More information about the llvm-commits mailing list