summaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/Analysis.h
diff options
context:
space:
mode:
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 78bf9fc..f8a7029 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.
OpenPOWER on IntegriCloud