summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 03:32:53 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 03:32:53 +0000
commit971591297861ddeb245f90c48ec7c24726efb9a9 (patch)
tree7045021e050876466c7025913c6ed263030348f3 /include
parent4b6af8aa5bfec80453cee247d89ab889cbbadd70 (diff)
downloadllvm-971591297861ddeb245f90c48ec7c24726efb9a9.tar.gz
llvm-971591297861ddeb245f90c48ec7c24726efb9a9.tar.bz2
llvm-971591297861ddeb245f90c48ec7c24726efb9a9.tar.xz
add getVectorOperand/getIndexOperand accessors to ExtractElementInst.
Fix some const correctness problems in SelectInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instructions.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 14e3a64d68..29395ebca2 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -1217,10 +1217,13 @@ public:
return new(3) SelectInst(C, S1, S2, NameStr, InsertAtEnd);
}
- Value *getCondition() const { return Op<0>(); }
- Value *getTrueValue() const { return Op<1>(); }
- Value *getFalseValue() const { return Op<2>(); }
-
+ const Value *getCondition() const { return Op<0>(); }
+ const Value *getTrueValue() const { return Op<1>(); }
+ const Value *getFalseValue() const { return Op<2>(); }
+ Value *getCondition() { return Op<0>(); }
+ Value *getTrueValue() { return Op<1>(); }
+ Value *getFalseValue() { return Op<2>(); }
+
/// areInvalidOperands - Return a string if the specified operands are invalid
/// for a select operation, otherwise return null.
static const char *areInvalidOperands(Value *Cond, Value *True, Value *False);
@@ -1312,6 +1315,16 @@ public:
virtual ExtractElementInst *clone(LLVMContext &Context) const;
+ Value *getVectorOperand() { return Op<0>(); }
+ Value *getIndexOperand() { return Op<1>(); }
+ const Value *getVectorOperand() const { return Op<0>(); }
+ const Value *getIndexOperand() const { return Op<1>(); }
+
+ const VectorType *getVectorOperandType() const {
+ return reinterpret_cast<const VectorType*>(Instruction::getType());
+ }
+
+
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);