[PATCH] D62264: [CommandLine] WIP: Add new debug_opt that reduces down to size of DataType in Release builds.

Don Hinton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 14:56:58 PDT 2019


hintonda updated this revision to Diff 200825.
hintonda added a comment.

- Added cl::debug_opt_storage with specializations.

With this change, the current sizes are:

Debug build (note that this doesn't include the size of ArgStr or Desc):

  sizeof cl::Option: 136
  sizeof cl::opt<bool>: 168
  sizeof cl::opt<bool, true> -- with location: 168
  sizeof cl::debug_opt<bool>: 168
  sizeof cl::debug_opt<bool, true>  with location: 168

Release build (ArgStr and Desc are dropped):

  sizeof cl::Option: 128
  sizeof cl::opt<bool>: 160
  sizeof cl::opt<bool, true> -- with location: 160
  sizeof cl::debug_opt<bool>: 1
  sizeof cl::debug_opt<bool, true>  with location: 8


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62264/new/

https://reviews.llvm.org/D62264

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62264.200825.patch
Type: text/x-patch
Size: 9556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190522/06c84f9a/attachment.bin>


More information about the llvm-commits mailing list