summaryrefslogtreecommitdiff
path: root/include/llvm/ConstantHandling.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-01 05:55:13 +0000
committerChris Lattner <sabre@nondot.org>2001-11-01 05:55:13 +0000
commit76ac1a45b40a96d1e583e2576c04d19b7d23a99e (patch)
tree51d4394be85d2c43a17c209361b260b823f4b011 /include/llvm/ConstantHandling.h
parentd558426b0eee09fee17ed1a9ba771c654b878ba5 (diff)
downloadllvm-76ac1a45b40a96d1e583e2576c04d19b7d23a99e.tar.gz
llvm-76ac1a45b40a96d1e583e2576c04d19b7d23a99e.tar.bz2
llvm-76ac1a45b40a96d1e583e2576c04d19b7d23a99e.tar.xz
Implement constant propogation of null pointer values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ConstantHandling.h')
-rw-r--r--include/llvm/ConstantHandling.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ConstantHandling.h b/include/llvm/ConstantHandling.h
index d3af1bda46..9e9e760ea1 100644
--- a/include/llvm/ConstantHandling.h
+++ b/include/llvm/ConstantHandling.h
@@ -36,6 +36,7 @@
#include "llvm/ConstPoolVals.h"
#include "llvm/Instruction.h"
#include "llvm/Type.h"
+class PointerType;
namespace opt {
@@ -90,6 +91,8 @@ public:
virtual ConstPoolUInt *castToULong (const ConstPoolVal *V) const = 0;
virtual ConstPoolFP *castToFloat (const ConstPoolVal *V) const = 0;
virtual ConstPoolFP *castToDouble(const ConstPoolVal *V) const = 0;
+ virtual ConstPoolPointer *castToPointer(const ConstPoolVal *V,
+ const PointerType *Ty) const = 0;
inline ConstPoolVal *castTo(const ConstPoolVal *V, const Type *Ty) const {
switch (Ty->getPrimitiveID()) {
@@ -104,6 +107,7 @@ public:
case Type::LongTyID: return castToLong(V);
case Type::FloatTyID: return castToFloat(V);
case Type::DoubleTyID: return castToDouble(V);
+ case Type::PointerTyID:return castToPointer(V, (PointerType*)Ty);
default: return 0;
}
}