Implement the ExtractValueInst::getIndexedType that accepts one
authorDan Gohman <gohman@apple.com>
Tue, 17 Jun 2008 21:07:55 +0000 (21:07 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 17 Jun 2008 21:07:55 +0000 (21:07 +0000)
index value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52432 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instructions.cpp

index 80a24f9ff9f3a83e4a5784692494002253a4a9ff..604f9f94a1c178b601357a31671646d72918687c 100644 (file)
@@ -1460,6 +1460,12 @@ const Type* ExtractValueInst::getIndexedType(const Type *Agg,
   return CurIdx == NumIdx ? Agg : 0;
 }
 
+const Type* ExtractValueInst::getIndexedType(const Type *Agg,
+                                             const unsigned Idx) {
+  const unsigned Idxs[1] = { Idx };
+  return getIndexedType(Agg, &Idxs[0], 1);
+}
+
 ExtractValueInst::ExtractValueInst(Value *Agg,
                                    unsigned Idx,
                                    const std::string &Name,