CodeGen: Fix missing debug loc due to alloca
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 24 Oct 2017 19:14:43 +0000 (19:14 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 24 Oct 2017 19:14:43 +0000 (19:14 +0000)
commite45b3d5dad003d71da8df2692bf11c5c1f429434
treea8ec9047111b6a5360817808edb703b8c65c4a78
parentb71d1b8a54b0e4c5d636d0986b78028ba606dcb4
CodeGen: Fix missing debug loc due to alloca

Builder save/restores insertion pointer when emitting addr space cast
for alloca, but does not save/restore debug loc, which causes verifier
failure for certain call instructions.

This patch fixes that.

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

llvm-svn: 316484
clang/lib/CodeGen/CGExpr.cpp
clang/test/CodeGenOpenCL/func-call-dbg-loc.cl [new file with mode: 0644]