[all-commits] [llvm/llvm-project] 703479: Replace redundant code in FormatManager and Format...

adrian-prantl via All-commits all-commits at lists.llvm.org
Tue Dec 10 10:27:24 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7034794b314d9de808de004d22b47f18d134757d
      https://github.com/llvm/llvm-project/commit/7034794b314d9de808de004d22b47f18d134757d
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2019-12-10 (Tue, 10 Dec 2019)

  Changed paths:
    M lldb/include/lldb/DataFormatters/FormatCache.h
    M lldb/include/lldb/DataFormatters/FormatManager.h
    M lldb/include/lldb/DataFormatters/TypeCategoryMap.h
    M lldb/source/DataFormatters/FormatCache.cpp
    M lldb/source/DataFormatters/FormatManager.cpp
    M lldb/source/DataFormatters/LanguageCategory.cpp
    M lldb/source/DataFormatters/TypeCategoryMap.cpp

  Log Message:
  -----------
  Replace redundant code in FormatManager and FormatCache with templates (NFC)

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.

rdar://problem/57756763

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




More information about the All-commits mailing list