[Lldb-commits] [PATCH] D71231: Replace redundant code in FormatManager and FormatCache with templates (NFC)

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 9 16:25:46 PST 2019


aprantl created this revision.
aprantl added reviewers: jingham, shafik, davide, labath.

This is a preparatory patch for an upcoming bugfix.

FormatManager and friends have four identical implementations of many accessor functions to deal with the four types of shared pointers in the FormatCache. This patch replaces these implementations with templates. While this patch drastically reduces the amount of source code and its maintainablity, it doesn't actually improve code size. I'd argue, this is still an improvement.


https://reviews.llvm.org/D71231

Files:
  lldb/include/lldb/DataFormatters/FormatCache.h
  lldb/include/lldb/DataFormatters/FormatManager.h
  lldb/include/lldb/DataFormatters/TypeCategoryMap.h
  lldb/source/DataFormatters/FormatCache.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/LanguageCategory.cpp
  lldb/source/DataFormatters/TypeCategoryMap.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71231.232956.patch
Type: text/x-patch
Size: 37305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191210/1456428d/attachment-0001.bin>


More information about the lldb-commits mailing list