[Lldb-commits] [PATCH] D101556: [lldb] Move and clean-up the Declaration class (NFC)

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 30 03:27:25 PDT 2021


teemperor accepted this revision.
teemperor added a comment.

In D101556#2727603 <https://reviews.llvm.org/D101556#2727603>, @mib wrote:

> In D101556#2726434 <https://reviews.llvm.org/D101556#2726434>, @teemperor wrote:
>
>> IIRC they were #ifdef's out because of memory concerns. Did you have a chance to benchmark this quickly (e.g., trying to attach to a debug Clang and see how much it increases memory)
>>
>> Otherwise this LGTM.
>>
>> FWIW, we also need this for the SourceLocation in Clang Decls feature I was working on some time ago.
>
> I ran a benchmark as you suggested, attaching to a debug clang build, checking lldb's memory before starting the process (650MB), setting a breakpoint to main then launching the process (~1GB), and after the process stops, I tried evaluating the following expression : `(lldb) expr std::string("This is a string.", 4)` (4.83GB) and the memory usage matched in both scenarios.

Thanks. I anyway realized we don't actually increase the memory consumption with that member as it just occupies what was previously tail padding (we actually still have padding left with this uint16_t member). I probably should have checked that before asking for benchmarks :)

LGTM, let's ship it.



================
Comment at: lldb/include/lldb/Core/Declaration.h:198
 protected:
-  /// Member variables.
-  FileSpec m_file; ///< The file specification that points to the
-                   ///< source file where the declaration occurred.
-  uint32_t m_line; ///< Non-zero values indicates a valid line number,
-                   ///< zero indicates no line number information is available.
-#ifdef LLDB_ENABLE_DECLARATION_COLUMNS
-  uint32_t m_column; ///< Non-zero values indicates a valid column number,
-                     ///< zero indicates no column information is available.
-#endif
+  // Member variables.
+  /// The file specification that points to the source file where the declaration occurred.
----------------
JDevlieghere wrote:
> This is useless. 
I personally learned C++ by reading LLDB's comments such as "Destructor", "Constructor" and "member variables"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101556



More information about the lldb-commits mailing list