Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)
commita9a3bc268b9b2bb6eb9c85141bc72263c24a4f60
treebae33403dc3a81039602d817e207c92fda8b46e2
parent0d1ad626e89441c576418f92f7fd77924aa7e804
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.

Currently some users of this function do this explicitly, and all the
rest forget to do this.

ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.

This is another change relevant to PR23837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240460 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/BasicBlockUtils.h
lib/Transforms/Utils/BasicBlockUtils.cpp
test/Instrumentation/ThreadSanitizer/atomic.ll