aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-13 00:38:57 +0000
committerChris Lattner <sabre@nondot.org>2001-12-13 00:38:57 +0000
commit682ea21397436e49eabbe13432e527869f07b0e0 (patch)
treebd17d2eea103b7439955958476b91ad6d622def7
parent2836e8e7aac47461235fb678e601aaeb2ca6a555 (diff)
Constants KNOW they are of a derived type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1439 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Constants.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 08fc8b369b..7ce2feced7 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -232,6 +232,9 @@ public:
static ConstantArray *get(const string &Initializer);
virtual string getStrValue() const;
+ inline const ArrayType *getType() const {
+ return (ArrayType*)Value::getType();
+ }
inline const vector<Use> &getValues() const { return Operands; }
@@ -263,6 +266,9 @@ public:
const vector<Constant*> &V);
virtual string getStrValue() const;
+ inline const StructType *getType() const {
+ return (StructType*)Value::getType();
+ }
inline const vector<Use> &getValues() const { return Operands; }
@@ -292,6 +298,9 @@ protected:
~ConstantPointer() {}
public:
virtual string getStrValue() const = 0;
+ inline const PointerType *getType() const {
+ return (PointerType*)Value::getType();
+ }
// isNullValue - Return true if this is the value that would be returned by
// getNullConstant.