aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-08-22 01:23:31 +0000
committerVedant Kumar <vsk@apple.com>2018-08-22 01:23:31 +0000
commit476068682336cc7303ff151b25efc03bb7c6ada7 (patch)
tree0e7f6e7427edd21eaaf8bcfe5f14e6d7b57537fa /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent6e9fd1377d8a2a10f61da56cea1c81925a1143bb (diff)
downloadllvm-476068682336cc7303ff151b25efc03bb7c6ada7.zip
llvm-476068682336cc7303ff151b25efc03bb7c6ada7.tar.gz
llvm-476068682336cc7303ff151b25efc03bb7c6ada7.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 5209ddb..37afed4 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();