diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-14 06:38:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-14 06:38:46 +0000 |
commit | cd45bc40862b3ba628fe8870dc9ec808ff31fad9 (patch) | |
tree | 85dd40fa26874232243a2d9208cdb161b13a124f /llvm/lib/Bytecode | |
parent | 116c4f73ad075b5176c9ab58f62565a9aa4c1abf (diff) | |
download | bcm5719-llvm-cd45bc40862b3ba628fe8870dc9ec808ff31fad9.tar.gz bcm5719-llvm-cd45bc40862b3ba628fe8870dc9ec808ff31fad9.zip |
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.
llvm-svn: 9994
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r-- | llvm/lib/Bytecode/Reader/ReaderInternals.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Bytecode/Reader/ReaderInternals.h b/llvm/lib/Bytecode/Reader/ReaderInternals.h index 81ccde97fff..c75c6557648 100644 --- a/llvm/lib/Bytecode/Reader/ReaderInternals.h +++ b/llvm/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; |