From 476068682336cc7303ff151b25efc03bb7c6ada7 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 22 Aug 2018 01:23:31 +0000 Subject: [CodeGenPrepare] Set debug loc when widening a switch condition Set a debug location on the cast instruction used to widen a switch condition. llvm-svn: 340379 --- llvm/lib/CodeGen/CodeGenPrepare.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 5209ddbb792..37afed449f7 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -5853,6 +5853,7 @@ bool CodeGenPrepare::optimizeSwitchInst(SwitchInst *SI) { auto *ExtInst = CastInst::Create(ExtType, Cond, NewType); ExtInst->insertBefore(SI); + ExtInst->setDebugLoc(SI->getDebugLoc()); SI->setCondition(ExtInst); for (auto Case : SI->cases()) { APInt NarrowConst = Case.getCaseValue()->getValue(); -- cgit v1.2.3