From 806fb993fe78179ca087ac979c7b7a8488f1b7ff Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 5 Dec 2004 20:09:18 +0000 Subject: [PATCH] Add accessors for Constants in a ConstantStruct. llvm-svn: 18550 --- include/llvm/Constants.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 0663d60bfd7..fd960b3504d 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -418,6 +418,14 @@ public: return false; } + Constant* getElementAt(unsigned i) const { + return cast(Operands[i]); + } + + unsigned getNumElements() const { + return Operands.size(); + } + virtual void destroyConstant(); virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, bool DisableChecking = false);