[all-commits] [llvm/llvm-project] ada2e8: Reland "Correctly emit dwoIDs after ASTFileSignatu...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon Aug 24 02:54:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ada2e8ea67393aa8c44fe8e9d46be62df6d1c702
      https://github.com/llvm/llvm-project/commit/ada2e8ea67393aa8c44fe8e9d46be62df6d1c702
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-08-24 (Mon, 24 Aug 2020)

  Changed paths:
    M clang/include/clang/Basic/Module.h
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
    A clang/test/Modules/Inputs/DebugDwoId.h
    M clang/test/Modules/Inputs/module.map
    A clang/test/Modules/ModuleDebugInfoDwoId.cpp

  Log Message:
  -----------
  Reland "Correctly emit dwoIDs after ASTFileSignature refactoring (D81347)"

This relands D84013 but with a test that relies on less shell features to
hopefully make the test pass on Fuchsia (where the test from the previous patch
version strangely failed with a plain "Exit code 1").

Original summary:

D81347 changes the ASTFileSignature to be an array of 20 uint8_t instead of 5 uint32_t.
However, it didn't update the code in ObjectFilePCHContainerOperations that creates
the dwoID in the module from the ASTFileSignature (`Buffer->Signature` being the
array subclass that is now `std::array<uint8_t, 20>` instead of `std::array<uint32_t, 5>`).

```
  uint64_t Signature = [..] (uint64_t)Buffer->Signature[1] << 32 | Buffer->Signature[0]
```

This code works with the old ASTFileSignature  (where two uint32_t are enough to
fill the uint64_t), but after the patch this only took two bytes from the ASTFileSignature
and only partly filled the Signature uint64_t.

This caused that the dwoID in the module ref and the dwoID in the actual module no
longer match (which in turns causes that LLDB keeps warning about the dwoID's not
matching when debugging -gmodules-compiled binaries).

This patch just unifies the logic for turning the ASTFileSignature into an uint64_t which
makes the dwoID match again (and should prevent issues like that in the future).

Reviewed By: aprantl, dang

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




More information about the All-commits mailing list