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 | 9e60d8dbdc3f335a938331e7974808ff77d5e821 (patch) | |
tree | 40f1b08dabd61f151890d50a9b437592cf64e99f /lib/Bytecode/Writer/Writer.cpp | |
parent | aba5ff567146339942253433f8d93b56a3bc05d7 (diff) |
add support for undef values of opaque type, addressing PR541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | lib/Bytecode/Writer/Writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index cdda1c7410..d4f231b13d 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/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; |