aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-14 06:38:46 +0000
committerChris Lattner <sabre@nondot.org>2003-11-14 06:38:46 +0000
commit8dc6ba9a12c04444196c8231833a55b0630d2838 (patch)
treeed4095a2defbf4435d78ac74588f5c2c2570a878 /lib/Bytecode
parent60e9742e8270c44f5fd83dd269633681bee42cb5 (diff)
Fix PR 110: the constant folding code assumes that if something is not a
constant expression, but is of (for example) ubyte type, then it is a ConstantUInt. This was not true for placeholders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/ReaderInternals.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h
index 81ccde97ff..c75c655764 100644
--- a/lib/Bytecode/Reader/ReaderInternals.h
+++ b/lib/Bytecode/Reader/ReaderInternals.h
@@ -14,7 +14,7 @@
#ifndef READER_INTERNALS_H
#define READER_INTERNALS_H
-#include "llvm/Constant.h"
+#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/ModuleProvider.h"
@@ -201,10 +201,8 @@ public:
unsigned getID() { return ID; }
};
-struct ConstantPlaceHolderHelper : public Constant {
- ConstantPlaceHolderHelper(const Type *Ty)
- : Constant(Ty) {}
- virtual bool isNullValue() const { return false; }
+struct ConstantPlaceHolderHelper : public ConstantExpr {
+ ConstantPlaceHolderHelper(const Type *Ty) : ConstantExpr(Instruction::UserOp1, Constant::getNullValue(Ty), Ty) {}
};
typedef PlaceholderDef<ConstantPlaceHolderHelper> ConstPHolder;