[Lldb-commits] [PATCH] D62477: DWARFASTParserClang: Move attribute parsing into a single function

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 27 03:25:27 PDT 2019

labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: jdoerfert.

The ParseTypeFromDWARF function consists of a huge switch on the kind of
type being parsed. Each case in this switch starts with parsing the
attributes of the current DIE. A lot of these attributes are specific to
one kind of a type, but a lot of them are common too, leading to code

This patch reduces the duplication (and the size of ParseTypeFromDWARF)
by moving the attribute parsing to a separate function. It creates a
struct (ParsedTypeAttributes), which contains a parsed form of all
attributes which are useful for parsing any kind of a type. The parsing
code for a specific type kind can then access the fields which are
relevant for that specific case.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62477.201491.patch
Type: text/x-patch
Size: 62608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190527/bacb1101/attachment-0001.bin>

More information about the lldb-commits mailing list