From 1243e1c9f1ab92d1462040fa5e198b1be99f9f7f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 5 May 2005 22:21:19 +0000 Subject: add support for undef values of opaque type, addressing PR541 llvm-svn: 21701 --- llvm/lib/Bytecode/Writer/Writer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp') diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index cdda1c7410c..d4f231b13d5 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -843,8 +843,8 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector } } -static inline bool hasNullValue(unsigned TyID) { - return TyID != Type::LabelTyID && TyID != Type::VoidTyID; +static inline bool hasNullValue(const Type *Ty) { + return Ty != Type::LabelTy && Ty != Type::VoidTy && !isa(Ty); } void BytecodeWriter::outputConstants(bool isFunction) { @@ -867,7 +867,7 @@ void BytecodeWriter::outputConstants(bool isFunction) { if (isFunction) // Don't re-emit module constants ValNo += Table.getModuleLevel(pno); - if (hasNullValue(pno)) { + if (hasNullValue(Plane[0]->getType())) { // Skip zero initializer if (ValNo == 0) ValNo = 1; -- cgit v1.2.3