diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-05 22:21:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-05 22:21:19 +0000 |
commit | 1243e1c9f1ab92d1462040fa5e198b1be99f9f7f (patch) | |
tree | 9d0ddd97bcf717a102d226a8a94151f991692a74 /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | 7ddaeb448b8d01faa4c6af0e2626f07a454db7f4 (diff) | |
download | bcm5719-llvm-1243e1c9f1ab92d1462040fa5e198b1be99f9f7f.tar.gz bcm5719-llvm-1243e1c9f1ab92d1462040fa5e198b1be99f9f7f.zip |
add support for undef values of opaque type, addressing PR541
llvm-svn: 21701
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<const Value*> } } -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<OpaqueType>(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; |