From 90865150e4f45f8c7da9b40cba3f3a815d304ab4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 14 Dec 2001 16:30:51 +0000 Subject: Remove unsized array support git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1461 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Reader/ConstantReader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/Bytecode/Reader/ConstantReader.cpp') diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp index 671afd2066..78da567f01 100644 --- a/lib/Bytecode/Reader/ConstantReader.cpp +++ b/lib/Bytecode/Reader/ConstantReader.cpp @@ -55,7 +55,7 @@ const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf, const Type *ElementType = getType(ElTyp); if (ElementType == 0) return failure(Val); - int NumElements; + unsigned NumElements; if (read_vbr(Buf, EndBuf, NumElements)) return failure(Val); BCR_TRACE(5, "Array Type Constant #" << ElTyp << " size=" @@ -239,11 +239,7 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf, case Type::ArrayTyID: { const ArrayType *AT = cast(Ty); - unsigned NumElements; - if (AT->isSized()) // Sized array, # elements stored in type! - NumElements = (unsigned)AT->getNumElements(); - else // Unsized array, # elements stored in stream! - if (read_vbr(Buf, EndBuf, NumElements)) return failure(true); + unsigned NumElements = AT->getNumElements(); vector Elements; while (NumElements--) { // Read all of the elements of the constant. @@ -320,6 +316,7 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf, break; } default: + BCR_TRACE(5, "UNKNOWN Pointer Constant Type!\n"); return failure(true); } break; -- cgit v1.2.3-18-g5258