[Lldb-commits] [PATCH] D61003: PostfixExpression: move parser out of NativePDB internals

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 23 05:12:06 PDT 2019


labath created this revision.
labath added reviewers: amccarth, clayborg, JDevlieghere, aleksandr.urakov.
Herald added a subscriber: mgorny.

The postfix expressions in PDB and breakpad symbol files are similar
enough that they can be parsed by the same parser. This patch
generalizes the parser in the NativePDB plugin and moves it into the
PostfixExpression file created in the previous commit (r358976).

The generalization consists of treating any unrecognised token as a
"symbol" node (previously these would only be created for tokens
starting with "$", and other token would abort the parse). This is
needed because breakpad symbols can also contain ".cfa" tokens, which
refer to the frame's CFA.

The cosmetic changes include:

- using a factory function instead of a class for creating nodes (this is more generic as it allows the same BumpPtrAllocator to be used for other things too)
- using dedicated function for parsing operator tokens instead of a DenseMap (more efficient as we don't need to create the DenseMap every time).


https://reviews.llvm.org/D61003

Files:
  include/lldb/Symbol/PostfixExpression.h
  source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
  source/Symbol/CMakeLists.txt
  source/Symbol/PostfixExpression.cpp
  unittests/Symbol/CMakeLists.txt
  unittests/Symbol/PostfixExpressionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61003.196216.patch
Type: text/x-patch
Size: 13522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190423/fdf1f016/attachment.bin>


More information about the lldb-commits mailing list