[Lldb-commits] [PATCH] D51557: Replace uses of LazyBool with LazyBool template

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 31 13:51:41 PDT 2018


teemperor created this revision.
teemperor added a reviewer: davide.
Herald added subscribers: lldb-commits, abidh, JDevlieghere, mgorny.

This patch introduces a LazyMember template that allows specifying member variables
which values will be computed once they are read the first time. This is supposed to
replace the previously used LazyBool enum that is partly providing the same functionality
(but you have to do all the checks yourself).

The advantages of LazyMember over handwritten LazyBool code are:

- No more manual checking when reading the value somewhere.
- The compiler enforces now that we actually set a value before returning to the user.
- We can optimize this code further in the future for space/time without

having to revisit all the different places that use LazyBool.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51557

Files:
  include/lldb/DataFormatters/ValueObjectPrinter.h
  include/lldb/Symbol/CompileUnit.h
  include/lldb/Target/ObjCLanguageRuntime.h
  include/lldb/Utility/Lazy.h
  source/DataFormatters/ValueObjectPrinter.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Symbol/CompileUnit.cpp
  source/Target/ObjCLanguageRuntime.cpp
  unittests/Utility/CMakeLists.txt
  unittests/Utility/LazyTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51557.163588.patch
Type: text/x-patch
Size: 20817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180831/a52b9848/attachment-0001.bin>


More information about the lldb-commits mailing list