[all-commits] [llvm/llvm-project] fe0129: Move FormattersMatchCandidate flags to a struct.

Jorge Gorbe Moya via All-commits all-commits at lists.llvm.org
Tue Aug 9 10:49:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe01292457fc04532c5d2eccc9d0674df4582fa6
      https://github.com/llvm/llvm-project/commit/fe01292457fc04532c5d2eccc9d0674df4582fa6
  Author: Jorge Gorbe Moya <jgorbe at google.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    M lldb/include/lldb/DataFormatters/FormatClasses.h
    M lldb/include/lldb/DataFormatters/FormatManager.h
    M lldb/source/DataFormatters/FormatManager.cpp

  Log Message:
  -----------
  Move FormattersMatchCandidate flags to a struct.

This removes some error-prone repetition in
FormatManager::GetPossibleMatches, where the same three boolean flags
are passed in a row multiple times as arguments to recursive calls to
GetPossibleMatches.

Instead of:
```
  // same flags, but with did_strip_typedef set to true.
  GetPossibleMatches(..., did_strip_ptr, did_strip_ref, true);
```
we can now say
```
  GetPossibleMatches(..., current_flags.WithStrippedTypedef());
```
which hopefully makes the intent clearer, and more readable in case we
add another flag.

Reviewed by: DavidSpickett, labath

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




More information about the All-commits mailing list