[all-commits] [llvm/llvm-project] 888ce7: [DebugInfo] Fix DWARF expressions for __block vars...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon May 17 05:32:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 888ce70af288168136cf1ca658c3cf6d6759bb3f
      https://github.com/llvm/llvm-project/commit/888ce70af288168136cf1ca658c3cf6d6759bb3f
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2021-05-17 (Mon, 17 May 2021)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/test/CodeGen/debug-info-block-expr.c

  Log Message:
  -----------
  [DebugInfo] Fix DWARF expressions for __block vars that are not on the heap

`__block` variables used to be always stored on the head instead of stack.
D51564 allowed `__block` variables to the stored on the stack like normal
variablesif they not captured by any escaping block, but the debug-info
generation code wasn't made aware of it so we still unconditionally emit DWARF
expressions pointing to the heap.

This patch makes CGDebugInfo use the `EscapingByref` introduced in D51564 that
tracks whether the `__block` variable is actually on the heap. If it's stored on
the stack instead we just use the debug info we would generate for normal
variables instead.

Reviewed By: ahatanak, aprantl

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




More information about the All-commits mailing list