This is an archive of the discontinued LLVM Phabricator instance.

Part 1 of Many: Refactoring llvm command line parsing
AbandonedPublic

Authored by beanz on Jan 20 2015, 4:09 PM.

Details

Reviewers
chandlerc
Summary

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.

Other changes:

  • Minor changes to MachinePassRegistry.cpp, LegacyPassNameParser.cpp, and Pass.cpp to support changes to Parser.Initailize()
  • Exposed a new API for tools to hide unrelated options (I have patches for clang to adopt)

*Fixed an issue with CommandLineTest caused by the new registration model.

Diff Detail

Event Timeline

beanz updated this revision to Diff 18465.Jan 20 2015, 4:09 PM
beanz retitled this revision from to Part 1 of Many: Refactoring llvm command line parsing.
beanz updated this object.
beanz edited the test plan for this revision. (Show Details)
beanz added a reviewer: chandlerc.
beanz added a subscriber: Unknown Object (MLST).
majnemer added inline comments.
include/llvm/CodeGen/MachinePassRegistry.h
125

Pointers should bind to the variable.

include/llvm/IR/LegacyPassNameParser.h
45–49

Pointers should be on the right hand side.

include/llvm/Support/CommandLine.h
532

Space before the curly brace, isn't the semicolon useless?

beanz abandoned this revision.Jan 21 2015, 11:00 AM

Thanks for the feedback.

Based on feedback from Duncan and Chandler on the mailing list I'm going to break out a few parts of this into separate patches.

I've posted the first here:

http://reviews.llvm.org/D7100