Update getMergedLocation to check the instruction type and merge properly.
authorDehao Chen <dehao@google.com>
Mon, 2 Oct 2017 18:13:14 +0000 (18:13 +0000)
committerDehao Chen <dehao@google.com>
Mon, 2 Oct 2017 18:13:14 +0000 (18:13 +0000)
commitf464627f2828b3496456a41b5697f31c6756431f
tree5c74c754c0bf8c82e24f97a18b4d0c896308c04c
parentbf11424b7fcabf997c2d43c7d0d9949351588b45
Update getMergedLocation to check the instruction type and merge properly.

Summary: If the merged instruction is call instruction, we need to set the scope to the closes common scope between 2 locations, otherwise it will cause trouble when the call is getting inlined.

Reviewers: dblaikie, aprantl

Reviewed By: dblaikie, aprantl

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 314694
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/IR/Instruction.h
llvm/lib/IR/DebugInfo.cpp
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/remove-debug.ll