]> granicus.if.org Git - clang/commit
Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option...
authorDon Hinton <hintonda@gmail.com>
Wed, 10 Jul 2019 17:57:05 +0000 (17:57 +0000)
committerDon Hinton <hintonda@gmail.com>
Wed, 10 Jul 2019 17:57:05 +0000 (17:57 +0000)
commit523e2cd1fe7c0242590b08ce4fcf67361f63f28c
treee35633713dca02754584ae851f2303ab2afb5031
parentbb2b9f6e0a049e3601aa60b070352c50f6859a26
Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class."

Previously reverted in 364141 due to buildbot breakage, and fixed here
by making GeneralCategory global a ManagedStatic.

Summary:
This change processes `OptionCategory`s and `SubCommand`s 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.

Reviewed By: serge-sans-paille

Tags: #llvm, #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365675 91177308-0d34-0410-b5e6-96231b3b80d8
tools/clang-refactor/ClangRefactor.cpp