summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 617d1c1cce3..3a6f56625b6 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -2632,6 +2632,8 @@ unsigned LLVMGetNumIndices(LLVMValueRef Inst) {
return EV->getNumIndices();
if (auto *IV = dyn_cast<InsertValueInst>(I))
return IV->getNumIndices();
+ if (auto *CE = dyn_cast<ConstantExpr>(I))
+ return CE->getIndices().size();
llvm_unreachable(
"LLVMGetNumIndices applies only to extractvalue and insertvalue!");
}
@@ -2642,6 +2644,8 @@ const unsigned *LLVMGetIndices(LLVMValueRef Inst) {
return EV->getIndices().data();
if (auto *IV = dyn_cast<InsertValueInst>(I))
return IV->getIndices().data();
+ if (auto *CE = dyn_cast<ConstantExpr>(I))
+ return CE->getIndices().data();
llvm_unreachable(
"LLVMGetIndices applies only to extractvalue and insertvalue!");
}
OpenPOWER on IntegriCloud