HomePhabricator

[CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

Authored by hintonda on Jun 22 2019, 10:22 AM.

Description

[CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

Summary:
This change processes OptionCategorys and SubCommands as they
are seen instead of caching them in the Option class and processing
them later. Doing so simplifies the work needed to be done by the Global
parser and significantly reduces the size of the Option class to a mere 64
bytes.

Removing the OptionCategory cache saved 24 bytes, and removing
the SubCommand cache saved an additional 48 bytes, for a total of a
72 byte reduction.

Reviewers: beanz, zturner, MaskRay, serge-sans-paille

Reviewed By: serge-sans-paille

Subscribers: serge-sans-paille, tstellar, zturner, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 364134