[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).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8019 bytes
Desc: not available
More information about the cfe-commits