[PATCH] D39305: Simplify codegen and debug info generation for block context parameters.

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 14:24:59 PDT 2017


aprantl created this revision.

The exisiting code goes out of its way to put block parameters into an alloca at -O0 only, but then describes the function argument (instead of the alloca) with a dbg.declare and the value loaded from the alloca with a dbg.value. Describing a function argument with a dbg.declare is undocumented in the LLVM-CFE contract and broke after LLVM r642022.

      

This patch just generates the alloca unconditionally, the mem2reg pass will eliminate it at -O1 and up anyway and points the dbg.declare to the alloca as intended (which mem2reg will then correctly rewrite into a dbg.value).

rdar://problem/35043980


Repository:
  rL LLVM

https://reviews.llvm.org/D39305

Files:
  lib/CodeGen/CGBlocks.cpp
  lib/CodeGen/CGDebugInfo.cpp
  lib/CodeGen/CGDebugInfo.h
  test/CodeGen/debug-info-block-vars.c
  test/CodeGenObjC/debug-info-block-captured-self.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39305.120312.patch
Type: text/x-patch
Size: 8019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171025/f6d0841a/attachment.bin>


More information about the cfe-commits mailing list