[Lldb-commits] [PATCH] D98653: [lldb] Refactor to support non-pointer instance variables (NFC)

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 15 12:51:29 PDT 2021


kastiglione created this revision.
kastiglione added reviewers: aprantl, teemperor, jingham, JDevlieghere, labath.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

`frame variable` contextually supports accessing ivars via a language's implicit
instance variable, ex `this` in C++ or `self` in ObjC.

It has been assumed that the instance variable is a pointer, resulting in `this->` or
`self->` prefixes. However some languages have a reference based instance variable
instead of a pointer. An example of this is Swift.

This changes `DeclContextIsClassMethod` and a few of its callers to return (via an out
pointer) whether the instance variable is a pointer or reference.

Some cleanup included:

1. The `language` parameter wasn't used and has been removed
2. The `is_instance_method` parameter is redundant and has been removed -- a non-empty `instance_var_name` indicates the context is an instance method
3. `IsClassMethod`'s parameters have been declared with default values of `nullptr`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98653

Files:
  lldb/include/lldb/Symbol/CompilerDeclContext.h
  lldb/include/lldb/Symbol/SymbolContext.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  lldb/source/Symbol/CompilerDeclContext.cpp
  lldb/source/Symbol/SymbolContext.cpp
  lldb/source/Target/StackFrame.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98653.330766.patch
Type: text/x-patch
Size: 12388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210315/06f95b49/attachment.bin>


More information about the lldb-commits mailing list