From 58e9a0bb1609fb35f2580f1b91ed7c4e9eb890d7 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 3 Nov 2017 18:00:02 +0000 Subject: Invoke salvageDebugInfo from CodeGenPrepare's SinkCast() This preserves the debug info for the cast operation in the original location. rdar://problem/33460652 llvm-svn: 317340 --- llvm/lib/Transforms/Utils/Local.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Utils/Local.cpp') diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 8c643c9..cb7978f 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1366,7 +1366,7 @@ void llvm::salvageDebugInfo(Instruction &I) { return MetadataAsValue::get(I.getContext(), ValueAsMetadata::get(V)); }; - if (isa(&I)) { + if (isa(&I) || isa(&I)) { findDbgValues(DbgValues, &I); for (auto *DVI : DbgValues) { // Bitcasts are entirely irrelevant for debug info. Rewrite the dbg.value -- cgit v1.1