[llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderInternals.h

Chris Lattner lattner at cs.uiuc.edu
Fri Nov 14 00:39:01 PST 2003


Changes in directory llvm/lib/Bytecode/Reader:

ReaderInternals.h updated: 1.64 -> 1.65

---
Log message:

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.


---
Diffs of the changes:  (+3 -5)

Index: llvm/lib/Bytecode/Reader/ReaderInternals.h
diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.64 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.65
--- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.64	Tue Nov 11 16:41:32 2003
+++ llvm/lib/Bytecode/Reader/ReaderInternals.h	Fri Nov 14 00:38:46 2003
@@ -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 @@
   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;





More information about the llvm-commits mailing list