[PATCH] D97881: [CodeView] Truncate Long Type Names With A Hash

Brock Wyma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 12:20:37 PST 2021


bwyma created this revision.
bwyma added reviewers: rnk, akhuang.
Herald added a subscriber: hiraditya.
bwyma requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When type names are too long to fit into a type record, the names need to be
truncated. The existing algorithm shrinks the name and unique name by
a proportionate amount until they fit into a type record. If the unique name
is significantly shorter then it can be reduced to a zero length string
resulting in the following crash:

    
  Failure value returned from cantFail wrapped call
  Stream Error: The stream is too short to perform the requested operation.
  UNREACHABLE executed at llvm/include/llvm/Support/Error.h:718!
  PLEASE submit a bug report to https://bugs.llvm.org/ ...
    

Instead, reduce the size of the type record by:

1. Replacing the entire linkage name with an MD5 hash.
2. Truncate the source name and append an MD5 hash.

This matches the behavior of Visual Studio 2017.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97881

Files:
  llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
  llvm/test/DebugInfo/COFF/long-type-name.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97881.327880.patch
Type: text/x-patch
Size: 288048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210303/6c03c890/attachment-0001.bin>


More information about the llvm-commits mailing list