diff options
| author | Vedant Kumar <vsk@apple.com> | 2018-05-23 22:03:48 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2018-05-23 22:03:48 +0000 |
| commit | 9374c0432b9dc10dc239907671b4f8b8d9653bdb (patch) | |
| tree | 0b66351948ab6131ee6cded3208dc73cf1582358 /llvm/lib/CodeGen | |
| parent | eadce02741ad5044c764bc22ed18d60892e4529d (diff) | |
| download | bcm5719-llvm-9374c0432b9dc10dc239907671b4f8b8d9653bdb.tar.gz bcm5719-llvm-9374c0432b9dc10dc239907671b4f8b8d9653bdb.zip | |
[DebugInfo] Maintain DI for sunken bitcasts
When a bitcast is being sunk in -codegenprepare pass, its DI wasn't
copied over to the newly created instruction. This patch fixes that
bug.
Patch by Kareem Ergawy!
Differential Revision: https://reviews.llvm.org/D47282
llvm-svn: 333133
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 92996eb3fee..1b8d5b32930 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1050,6 +1050,7 @@ static bool SinkCast(CastInst *CI) { assert(InsertPt != UserBB->end()); InsertedCast = CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "", &*InsertPt); + InsertedCast->setDebugLoc(CI->getDebugLoc()); } // Replace a use of the cast with a use of the new cast. |

