[all-commits] [llvm/llvm-project] c1059d: [AppleAccelTable] Keep track of the size of each h...

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Thu Jun 8 11:21:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1059dcb1c88405bff4d3ceaa58af22c2f8c536e
      https://github.com/llvm/llvm-project/commit/c1059dcb1c88405bff4d3ceaa58af22c2f8c536e
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2023-06-08 (Thu, 08 Jun 2023)

  Changed paths:
    M llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
    M llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
    M llvm/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
    M llvm/test/tools/dsymutil/X86/basic-lto-linking-x86.test
    M llvm/test/tools/dsymutil/X86/objc.test
    M llvm/test/tools/llvm-dwarfdump/X86/apple_names_verify_form.s

  Log Message:
  -----------
  [AppleAccelTable] Keep track of the size of each hash data entry

In a future patch, it will be desirable to skip over all hash data entries for a
particular string. In order to do so, we must know how many bytes each of those
entries have.

In its full specification, Apple tables allow for variable length entries, which
would make the above impossible without reading the data of each entry. However,
this is largely unsupported today (as a FIXME in the code indicates, there is a
bug with hash collisions exactly because we don't know how to skip over data),
and the documentation[1] states that:

> For the current implementations of the “.apple_names” (all functions +
> globals), the “.apple_types” (names of all types that are defined), and the
> “.apple_namespaces” (all namespaces), we currently set the Atom array to be:
> [...]
> This defines the contents to be the DIE offset (eAtomTypeDIEOffset) that is
> encoded as a 32 bit value (DW_FORM_data4).

In other words, we only produce fixed sized entries.

A few tests containing invalid dwarf had to be updated, as the error is now
detected earlier (when the accelerator table is being parsed, instead of inside
the explicit call to "verify").

[1]: https://llvm.org/docs/SourceLevelDebugging.html#fixed-lookup

Depends on D152156

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




More information about the All-commits mailing list