7 Commits

Author SHA1 Message Date
Pavel Labath
b64767750b [CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.

Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)

Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: echristo, clayborg, vleschuk, llvm-commits

Differential Revision: https://reviews.llvm.org/D43285

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-19 16:12:20 +00:00
Pavel Labath
cfb2d8c301 [CodeGen] Optimize AccelTable
Summary:
The class contained arrays of two structures (DataArray and HashData).
These structures were in 1:1 correspondence, and one of them contained
pointers to the other (and *both* contained a "Name" field). By merging
these two structures into one, we can save a bit of space without
negatively impacting much of anything.

Reviewers: JDevlieghere, aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D43073

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324724 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-09 10:06:56 +00:00
Jonas Devlieghere
af8973d6a6 [AccelTable] Move print methods to implementation. NFC
This patch moves the implementation of the print methods from the header
to the cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323757 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 13:36:30 +00:00
Jonas Devlieghere
0e79832916 [AccelTable] Workaround for MSVC bug
Microsoft Visual Studio rejects the static constexpr static list of
atoms even though it's valid C++. This provides a workaround to unbreak
the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323667 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 17:28:51 +00:00
Jonas Devlieghere
ba63532a00 [AccelTable] Try making MSVC happy
MSVC complains that the constexpr "expression did not evaluate to a
constant". Trying to make it happy by adding a `const` specifier as
suggested in https://stackoverflow.com/questions/37574343.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323659 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 15:23:34 +00:00
Jonas Devlieghere
a9aab590d5 [dsymutil] Generate Apple accelerator tables
This patch adds support for generating accelerator tables in dsymutil.
This feature was already present in our internal repository but not yet
upstreamed because it requires changes to the Apple accelerator table
implementation.

Differential revision: https://reviews.llvm.org/D42501

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 14:52:50 +00:00
Jonas Devlieghere
633599ba03 [NFC] Rename DwarfAccelTable and move header.
This patch renames DwarfAccelTable.{h,cpp} to AccelTable.{h,cpp} and
moves the header to the include dir so it is accessible by the
dsymutil implementation.

Differential revision: https://reviews.llvm.org/D42529

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323654 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 14:52:41 +00:00