Go to file
David Stenberg 284827f32b [DebugInfo] Add interface for pre-calculating the size of emitted DWARF
Summary:
DWARF's DW_OP_entry_value operation has two operands; the first is a
ULEB128 operand that specifies the size of the second operand, which is
a DWARF block. This means that we need to be able to pre-calculate and
emit the size of DWARF expressions before emitting them. There is
currently no interface for doing this in DwarfExpression, so this patch
introduces that.

When implementing this I initially thought about running through
DwarfExpression's emission two times; first with a temporary buffer to
emit the expression, in order to being able to calculate the size of
that emitted data. However, DwarfExpression is a quite complex state
machine, so I decided against that, as it seemed like the two runs could
get out of sync, resulting in incorrect size operands. Therefore I have
implemented this in a way that we only have to run DwarfExpression once.
The idea is to emit DWARF to a temporary buffer, for which it is
possible to query the size. The data in the temporary buffer can then be
emitted to DwarfExpression's main output.

In the case of DIEDwarfExpression, a temporary DIE is used. The values
are all allocated using the same BumpPtrAllocator as for all other DIEs,
and the values are then transferred to the real value list. In the case
of DebugLocDwarfExpression, the temporary buffer is implemented using a
BufferByteStreamer which emits to a buffer in the DwarfExpression
object.

Reviewers: aprantl, vsk, NikolaPrica, djtodoro

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 374879
2019-10-15 11:14:35 +00:00
clang Fix uninitialized variable warnings. NFCI. 2019-10-15 10:23:05 +00:00
clang-tools-extra [clang-scan-deps] Support for clang --analyze in clang-scan-deps 2019-10-14 20:15:01 +00:00
compiler-rt tsan: fix Go ppc64le build 2019-10-15 08:38:58 +00:00
debuginfo-tests Make nrvo-string test more robust. 2019-06-27 20:38:37 +00:00
libc Use arrays on stack and avoid use of new and delete operators. 2019-10-10 16:06:21 +00:00
libclc travis: Add LLVM 9 build 2019-09-27 05:58:15 +00:00
libcxx [libc++][test] Use <version> to get config on MSVC 2019-10-15 00:22:38 +00:00
libcxxabi [libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option 2019-10-07 19:22:04 +00:00
libunwind [libunwind] Fix issues introduced in r374606 2019-10-12 01:50:57 +00:00
lld [LLD] [COFF] Update a leftover comment after SVN r374869. NFC. 2019-10-15 09:46:33 +00:00
lldb [LLDB] [PECOFF] Use a "pc" vendor name in aarch64 triples 2019-10-15 08:32:46 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [DebugInfo] Add interface for pre-calculating the size of emitted DWARF 2019-10-15 11:14:35 +00:00
openmp [OpenMP] Enable thread affinity on FreeBSD 2019-10-08 21:25:30 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [Polly] Fix formatting violation. NFC. 2019-10-11 03:09:24 +00:00
pstl [pstl] Allow customizing whether per-TU insulation is provided 2019-08-13 12:49:00 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.git-blame-ignore-revs Add LLDB reformatting to .git-blame-ignore-revs 2019-09-04 09:31:55 +00:00
.gitignore Add a newline at the end of the file 2019-09-04 06:33:46 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.