From: Don Hinton Date: Sat, 22 Jun 2019 17:22:50 +0000 (+0000) Subject: [CommandLine] Remove OptionCategory and SubCommand caches from the Option class. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4130c915bbb1643ec1d5297f2a1a20ad623f73f4;p=llvm [CommandLine] Remove OptionCategory and SubCommand caches from the Option class. 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. 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364134 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 3cc2c3c0121..2f88150b5a1 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -201,6 +201,8 @@ public: StringRef getName() const { return Name; } StringRef getDescription() const { return Description; } + + SmallPtrSet