summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/Analysis.h
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-13 10:26:04 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-13 10:26:04 +0000
commitfc6d3a49867cd38954dc40936a88f1907252c6d2 (patch)
tree427850758eca130b1354d38d7281569bb3528c52 /include/llvm/CodeGen/Analysis.h
parent5d4f9909c49d28db9572acc4513c1a695b0c53da (diff)
downloadllvm-fc6d3a49867cd38954dc40936a88f1907252c6d2.tar.gz
llvm-fc6d3a49867cd38954dc40936a88f1907252c6d2.tar.bz2
llvm-fc6d3a49867cd38954dc40936a88f1907252c6d2.tar.xz
Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/Analysis.h')
-rw-r--r--include/llvm/CodeGen/Analysis.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/Analysis.h b/include/llvm/CodeGen/Analysis.h
index 78bf9fc11a..f8a70293c1 100644
--- a/include/llvm/CodeGen/Analysis.h
+++ b/include/llvm/CodeGen/Analysis.h
@@ -16,6 +16,7 @@
#include "llvm/Instructions.h"
#include "llvm/InlineAsm.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGen/ISDOpcodes.h"
@@ -37,6 +38,12 @@ unsigned ComputeLinearIndex(const Type *Ty,
const unsigned *IndicesEnd,
unsigned CurIndex = 0);
+inline unsigned ComputeLinearIndex(const Type *Ty,
+ ArrayRef<unsigned> Indices,
+ unsigned CurIndex = 0) {
+ return ComputeLinearIndex(Ty, Indices.begin(), Indices.end(), CurIndex);
+}
+
/// ComputeValueVTs - Given an LLVM IR type, compute a sequence of
/// EVTs that represent all the individual underlying
/// non-aggregate types that comprise it.