HomeFreeBSD

Apply llvm fix for assertion failure compiling recent libc++

Description

Apply llvm fix for assertion failure compiling recent libc++

Merge commit c7c84b90879f from llvm git (by Adrian Prantl):

[DwarfDebug] Refuse to emit DW_OP_LLVM_arg values wider than 64 bits

DwarfExpression::addUnsignedConstant(const APInt &Value) only supports
wider-than-64-bit values when it is used to emit a top-level DWARF
expression representing the location of a variable. Before this change,
it was possible to call addUnsignedConstant on >64 bit values within a
subexpression when substituting DW_OP_LLVM_arg values.

This can trigger an assertion failure (e.g. PR52584, PR52333) when it
happens in a fragment (DW_OP_LLVM_fragment) expression, as
addUnsignedConstant on >64 bit values splits the constant into separate
DW_OP_pieces, which modifies DwarfExpression::OffsetInBits.

This change papers over the assertion errors by bailing on overly wide
DW_OP_LLVM_arg values. A more comprehensive fix might be to be to split
wide values into pointer-sized fragments.

[0] https://github.com/llvm/llvm-project/blob/e71fa03/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp#L799-L805

Patch by Ricky Zhou!

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

MFC after: 3 days

(cherry picked from commit 9738bc28abe85f7890d92c007a8e5b1d6eeebb53)

Details

Provenance
dimAuthored on Jan 29 2022, 9:28 PM
Parents
rGeacdf85d4410: dtrace: add a knob to control maximum size of principal buffers
Branches
Unknown
Tags
Unknown