[all-commits] [llvm/llvm-project] 1da449: [lldb] Add comment on cross printing of summary/va...

Dave Lee via All-commits all-commits at lists.llvm.org
Wed Feb 14 13:13:34 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1da4494184566d68f32206e3ac5a8b90bc05889d
      https://github.com/llvm/llvm-project/commit/1da4494184566d68f32206e3ac5a8b90bc05889d
  Author: Dave Lee <davelee.com at gmail.com>
  Date:   2024-02-14 (Wed, 14 Feb 2024)

  Changed paths:
    M lldb/source/Core/ValueObject.cpp

  Log Message:
  -----------
  [lldb] Add comment on cross printing of summary/value (#81681)

Adds a comment to indicate intention of a piece of value printing code.

I was initially surprised to see this code (distilled for emphasis):

```cpp
if (str.empty()) {
  if (style == eValueObjectRepresentationStyleValue)
    str = GetSummaryAsCString();
  else if (style == eValueObjectRepresentationStyleSummary)
    str = GetValueAsCString();
}
```

My first thought was "is this a bug?", but I realized it was likely intentional. This 
change adds a comment to indicate yes, this is intentional.




More information about the All-commits mailing list