Lines Matching full:record

172 /// Convert a string from a record into an std::string, return true on failure.
174 static bool convertToString(ArrayRef<uint64_t> Record, unsigned Idx, in convertToString() argument
176 if (Idx > Record.size()) in convertToString()
179 Result.append(Record.begin() + Idx, Record.end()); in convertToString()
200 SmallVector<uint64_t, 64> Record; in readIdentificationBlock() local
215 case BitstreamEntry::Record: in readIdentificationBlock()
220 // Read a record. in readIdentificationBlock()
221 Record.clear(); in readIdentificationBlock()
222 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in readIdentificationBlock()
229 convertToString(Record, 0, ProducerIdentification); in readIdentificationBlock()
232 unsigned epoch = (unsigned)Record[0]; in readIdentificationBlock()
267 case BitstreamEntry::Record: in readIdentificationCode()
279 SmallVector<uint64_t, 64> Record; in hasObjCCategoryInModule() local
294 case BitstreamEntry::Record: in hasObjCCategoryInModule()
299 // Read a record. in hasObjCCategoryInModule()
300 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in hasObjCCategoryInModule()
308 if (convertToString(Record, 0, S)) in hasObjCCategoryInModule()
309 return error("Invalid section name record"); in hasObjCCategoryInModule()
318 Record.clear(); in hasObjCCategoryInModule()
346 case BitstreamEntry::Record: in hasObjCCategory()
358 SmallVector<uint64_t, 64> Record; in readModuleTriple() local
375 case BitstreamEntry::Record: in readModuleTriple()
380 // Read a record. in readModuleTriple()
381 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in readModuleTriple()
388 if (convertToString(Record, 0, S)) in readModuleTriple()
389 return error("Invalid triple record"); in readModuleTriple()
394 Record.clear(); in readModuleTriple()
423 case BitstreamEntry::Record: in readTriple()
449 Expected<unsigned> parseVersionRecord(ArrayRef<uint64_t> Record);
452 /// and return the referenced string and the rest of the record. Otherwise
453 /// just return the record itself.
455 readNameFromStrtab(ArrayRef<uint64_t> Record);
476 BitcodeReaderBase::parseVersionRecord(ArrayRef<uint64_t> Record) { in parseVersionRecord() argument
477 if (Record.empty()) in parseVersionRecord()
478 return error("Invalid version record"); in parseVersionRecord()
479 unsigned ModuleVersion = Record[0]; in parseVersionRecord()
487 BitcodeReaderBase::readNameFromStrtab(ArrayRef<uint64_t> Record) { in readNameFromStrtab() argument
489 return {"", Record}; in readNameFromStrtab()
490 // Invalid reference. Let the caller complain about the record being empty. in readNameFromStrtab()
491 if (Record[0] + Record[1] > Strtab.size()) in readNameFromStrtab()
493 return {StringRef(Strtab.data() + Record[0], Record[1]), Record.slice(2)}; in readNameFromStrtab()
766 /// Read a value/type pair out of the specified record from slot 'Slot'.
767 /// Increment Slot past the number of slots used in the record. Return true on
769 bool getValueTypePair(const SmallVectorImpl<uint64_t> &Record, unsigned &Slot, in getValueTypePair() argument
772 if (Slot == Record.size()) return true; in getValueTypePair()
773 unsigned ValNo = (unsigned)Record[Slot++]; in getValueTypePair()
786 if (Slot == Record.size()) in getValueTypePair()
789 TypeID = (unsigned)Record[Slot++]; in getValueTypePair()
795 /// Read a value out of the specified record from slot 'Slot'. Increment Slot
796 /// past the number of slots used by the value in the record. Return true if
798 bool popValue(const SmallVectorImpl<uint64_t> &Record, unsigned &Slot, in popValue() argument
801 if (getValue(Record, Slot, InstNum, Ty, TyID, ResVal, ConstExprInsertBB)) in popValue()
803 // All values currently take a single record slot. in popValue()
809 bool getValue(const SmallVectorImpl<uint64_t> &Record, unsigned Slot, in getValue() argument
812 ResVal = getValue(Record, Slot, InstNum, Ty, TyID, ConstExprInsertBB); in getValue()
818 Value *getValue(const SmallVectorImpl<uint64_t> &Record, unsigned Slot, in getValue() argument
821 if (Slot == Record.size()) return nullptr; in getValue()
822 unsigned ValNo = (unsigned)Record[Slot]; in getValue()
830 Value *getValueSigned(const SmallVectorImpl<uint64_t> &Record, unsigned Slot, in getValueSigned() argument
833 if (Slot == Record.size()) return nullptr; in getValueSigned()
834 unsigned ValNo = (unsigned)decodeSignRotatedValue(Record[Slot]); in getValueSigned()
841 Expected<ConstantRange> readConstantRange(ArrayRef<uint64_t> Record, in readConstantRange() argument
844 if (Record.size() - OpNum < 2) in readConstantRange()
847 unsigned LowerActiveWords = Record[OpNum]; in readConstantRange()
848 unsigned UpperActiveWords = Record[OpNum++] >> 32; in readConstantRange()
849 if (Record.size() - OpNum < LowerActiveWords + UpperActiveWords) in readConstantRange()
852 readWideAPInt(ArrayRef(&Record[OpNum], LowerActiveWords), BitWidth); in readConstantRange()
855 readWideAPInt(ArrayRef(&Record[OpNum], UpperActiveWords), BitWidth); in readConstantRange()
859 int64_t Start = BitcodeReader::decodeSignRotatedValue(Record[OpNum++]); in readConstantRange()
860 int64_t End = BitcodeReader::decodeSignRotatedValue(Record[OpNum++]); in readConstantRange()
866 readBitWidthAndConstantRange(ArrayRef<uint64_t> Record, unsigned &OpNum) { in readBitWidthAndConstantRange() argument
867 if (Record.size() - OpNum < 1) in readBitWidthAndConstantRange()
869 unsigned BitWidth = Record[OpNum++]; in readBitWidthAndConstantRange()
870 return readConstantRange(Record, OpNum, BitWidth); in readBitWidthAndConstantRange()
886 Error parseComdatRecord(ArrayRef<uint64_t> Record);
887 Error parseGlobalVarRecord(ArrayRef<uint64_t> Record);
888 Error parseFunctionRecord(ArrayRef<uint64_t> Record);
890 ArrayRef<uint64_t> Record);
899 Expected<Value *> recordValue(SmallVectorImpl<uint64_t> &Record,
902 ArrayRef<uint64_t> Record);
935 /// Set to the offset of the VST recorded in the MODULE_CODE_VSTOFFSET record.
958 /// Original source file name recorded in a bitcode record.
969 /// Saves the stack ids from the STACK_IDS record to consult when adding stack
988 std::vector<ValueInfo> makeRefList(ArrayRef<uint64_t> Record);
989 std::vector<FunctionSummary::EdgeTy> makeCallList(ArrayRef<uint64_t> Record,
995 void parseTypeIdCompatibleVtableSummaryRecord(ArrayRef<uint64_t> Record);
996 void parseTypeIdCompatibleVtableInfo(ArrayRef<uint64_t> Record, size_t &Slot,
999 parseParamAccesses(ArrayRef<uint64_t> Record);
1946 SmallVector<uint64_t, 64> Record; in parseAttributeBlock() local
1963 case BitstreamEntry::Record: in parseAttributeBlock()
1968 // Read a record. in parseAttributeBlock()
1969 Record.clear(); in parseAttributeBlock()
1970 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseAttributeBlock()
1978 if (Record.size() & 1) in parseAttributeBlock()
1979 return error("Invalid parameter attribute record"); in parseAttributeBlock()
1981 for (unsigned i = 0, e = Record.size(); i != e; i += 2) { in parseAttributeBlock()
1983 decodeLLVMAttributesForBitcode(B, Record[i+1], Record[i]); in parseAttributeBlock()
1984 Attrs.push_back(AttributeList::get(Context, Record[i], B)); in parseAttributeBlock()
1991 for (uint64_t Val : Record) in parseAttributeBlock()
2240 SmallVector<uint64_t, 64> Record; in parseAttributeGroupBlock() local
2255 case BitstreamEntry::Record: in parseAttributeGroupBlock()
2260 // Read a record. in parseAttributeGroupBlock()
2261 Record.clear(); in parseAttributeGroupBlock()
2262 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseAttributeGroupBlock()
2269 if (Record.size() < 3) in parseAttributeGroupBlock()
2270 return error("Invalid grp record"); in parseAttributeGroupBlock()
2272 uint64_t GrpID = Record[0]; in parseAttributeGroupBlock()
2273 uint64_t Idx = Record[1]; // Index of the object this attribute refers to. in parseAttributeGroupBlock()
2277 for (unsigned i = 2, e = Record.size(); i != e; ++i) { in parseAttributeGroupBlock()
2278 if (Record[i] == 0) { // Enum attribute in parseAttributeGroupBlock()
2280 uint64_t EncodedKind = Record[++i]; in parseAttributeGroupBlock()
2303 } else if (Record[i] == 1) { // Integer attribute in parseAttributeGroupBlock()
2305 if (Error Err = parseAttrKind(Record[++i], &Kind)) in parseAttributeGroupBlock()
2310 B.addAlignmentAttr(Record[++i]); in parseAttributeGroupBlock()
2312 B.addStackAlignmentAttr(Record[++i]); in parseAttributeGroupBlock()
2314 B.addDereferenceableAttr(Record[++i]); in parseAttributeGroupBlock()
2316 B.addDereferenceableOrNullAttr(Record[++i]); in parseAttributeGroupBlock()
2318 B.addAllocSizeAttrFromRawRepr(Record[++i]); in parseAttributeGroupBlock()
2320 B.addVScaleRangeAttrFromRawRepr(Record[++i]); in parseAttributeGroupBlock()
2322 B.addUWTableAttr(UWTableKind(Record[++i])); in parseAttributeGroupBlock()
2324 B.addAllocKindAttr(static_cast<AllocFnKind>(Record[++i])); in parseAttributeGroupBlock()
2326 B.addMemoryAttr(MemoryEffects::createFromIntValue(Record[++i])); in parseAttributeGroupBlock()
2329 static_cast<FPClassTest>(Record[++i] & fcAllFlags)); in parseAttributeGroupBlock()
2330 } else if (Record[i] == 3 || Record[i] == 4) { // String attribute in parseAttributeGroupBlock()
2331 bool HasValue = (Record[i++] == 4); in parseAttributeGroupBlock()
2335 while (Record[i] != 0 && i != e) in parseAttributeGroupBlock()
2336 KindStr += Record[i++]; in parseAttributeGroupBlock()
2337 assert(Record[i] == 0 && "Kind string not null terminated"); in parseAttributeGroupBlock()
2342 while (Record[i] != 0 && i != e) in parseAttributeGroupBlock()
2343 ValStr += Record[i++]; in parseAttributeGroupBlock()
2344 assert(Record[i] == 0 && "Value string not null terminated"); in parseAttributeGroupBlock()
2348 } else if (Record[i] == 5 || Record[i] == 6) { in parseAttributeGroupBlock()
2349 bool HasType = Record[i] == 6; in parseAttributeGroupBlock()
2351 if (Error Err = parseAttrKind(Record[++i], &Kind)) in parseAttributeGroupBlock()
2356 B.addTypeAttr(Kind, HasType ? getTypeByID(Record[++i]) : nullptr); in parseAttributeGroupBlock()
2357 } else if (Record[i] == 7) { in parseAttributeGroupBlock()
2361 if (Error Err = parseAttrKind(Record[i++], &Kind)) in parseAttributeGroupBlock()
2367 readBitWidthAndConstantRange(Record, i); in parseAttributeGroupBlock()
2373 } else if (Record[i] == 8) { in parseAttributeGroupBlock()
2377 if (Error Err = parseAttrKind(Record[i++], &Kind)) in parseAttributeGroupBlock()
2385 unsigned RangeSize = Record[i++]; in parseAttributeGroupBlock()
2386 unsigned BitWidth = Record[i++]; in parseAttributeGroupBlock()
2389 readConstantRange(Record, i, BitWidth); in parseAttributeGroupBlock()
2426 SmallVector<uint64_t, 64> Record; in parseTypeTableBody() local
2446 case BitstreamEntry::Record: in parseTypeTableBody()
2451 // Read a record. in parseTypeTableBody()
2452 Record.clear(); in parseTypeTableBody()
2455 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseTypeTableBody()
2464 if (Record.empty()) in parseTypeTableBody()
2465 return error("Invalid numentry record"); in parseTypeTableBody()
2466 TypeList.resize(Record[0]); in parseTypeTableBody()
2508 if (Record.empty()) in parseTypeTableBody()
2509 return error("Invalid integer record"); in parseTypeTableBody()
2511 uint64_t NumBits = Record[0]; in parseTypeTableBody()
2520 if (Record.empty()) in parseTypeTableBody()
2521 return error("Invalid pointer record"); in parseTypeTableBody()
2523 if (Record.size() == 2) in parseTypeTableBody()
2524 AddressSpace = Record[1]; in parseTypeTableBody()
2525 ResultTy = getTypeByID(Record[0]); in parseTypeTableBody()
2529 ContainedIDs.push_back(Record[0]); in parseTypeTableBody()
2534 if (Record.size() != 1) in parseTypeTableBody()
2535 return error("Invalid opaque pointer record"); in parseTypeTableBody()
2536 unsigned AddressSpace = Record[0]; in parseTypeTableBody()
2543 if (Record.size() < 3) in parseTypeTableBody()
2544 return error("Invalid function record"); in parseTypeTableBody()
2546 for (unsigned i = 3, e = Record.size(); i != e; ++i) { in parseTypeTableBody()
2547 if (Type *T = getTypeByID(Record[i])) in parseTypeTableBody()
2553 ResultTy = getTypeByID(Record[2]); in parseTypeTableBody()
2554 if (!ResultTy || ArgTys.size() < Record.size()-3) in parseTypeTableBody()
2557 ContainedIDs.append(Record.begin() + 2, Record.end()); in parseTypeTableBody()
2558 ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]); in parseTypeTableBody()
2563 if (Record.size() < 2) in parseTypeTableBody()
2564 return error("Invalid function record"); in parseTypeTableBody()
2566 for (unsigned i = 2, e = Record.size(); i != e; ++i) { in parseTypeTableBody()
2567 if (Type *T = getTypeByID(Record[i])) { in parseTypeTableBody()
2576 ResultTy = getTypeByID(Record[1]); in parseTypeTableBody()
2577 if (!ResultTy || ArgTys.size() < Record.size()-2) in parseTypeTableBody()
2580 ContainedIDs.append(Record.begin() + 1, Record.end()); in parseTypeTableBody()
2581 ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]); in parseTypeTableBody()
2585 if (Record.empty()) in parseTypeTableBody()
2586 return error("Invalid anon struct record"); in parseTypeTableBody()
2588 for (unsigned i = 1, e = Record.size(); i != e; ++i) { in parseTypeTableBody()
2589 if (Type *T = getTypeByID(Record[i])) in parseTypeTableBody()
2594 if (EltTys.size() != Record.size()-1) in parseTypeTableBody()
2596 ContainedIDs.append(Record.begin() + 1, Record.end()); in parseTypeTableBody()
2597 ResultTy = StructType::get(Context, EltTys, Record[0]); in parseTypeTableBody()
2601 if (convertToString(Record, 0, TypeName)) in parseTypeTableBody()
2602 return error("Invalid struct name record"); in parseTypeTableBody()
2606 if (Record.empty()) in parseTypeTableBody()
2607 return error("Invalid named struct record"); in parseTypeTableBody()
2622 for (unsigned i = 1, e = Record.size(); i != e; ++i) { in parseTypeTableBody()
2623 if (Type *T = getTypeByID(Record[i])) in parseTypeTableBody()
2628 if (EltTys.size() != Record.size()-1) in parseTypeTableBody()
2629 return error("Invalid named struct record"); in parseTypeTableBody()
2630 Res->setBody(EltTys, Record[0]); in parseTypeTableBody()
2631 ContainedIDs.append(Record.begin() + 1, Record.end()); in parseTypeTableBody()
2636 if (Record.size() != 1) in parseTypeTableBody()
2637 return error("Invalid opaque type record"); in parseTypeTableBody()
2654 if (Record.size() < 1) in parseTypeTableBody()
2655 return error("Invalid target extension type record"); in parseTypeTableBody()
2660 if (Record[0] >= Record.size()) in parseTypeTableBody()
2663 unsigned NumTys = Record[0]; in parseTypeTableBody()
2667 if (Type *T = getTypeByID(Record[i + 1])) in parseTypeTableBody()
2673 for (unsigned i = NumTys + 1, e = Record.size(); i < e; i++) { in parseTypeTableBody()
2674 if (Record[i] > UINT_MAX) in parseTypeTableBody()
2676 IntParams.push_back(Record[i]); in parseTypeTableBody()
2683 if (Record.size() < 2) in parseTypeTableBody()
2684 return error("Invalid array type record"); in parseTypeTableBody()
2685 ResultTy = getTypeByID(Record[1]); in parseTypeTableBody()
2688 ContainedIDs.push_back(Record[1]); in parseTypeTableBody()
2689 ResultTy = ArrayType::get(ResultTy, Record[0]); in parseTypeTableBody()
2693 if (Record.size() < 2) in parseTypeTableBody()
2694 return error("Invalid vector type record"); in parseTypeTableBody()
2695 if (Record[0] == 0) in parseTypeTableBody()
2697 ResultTy = getTypeByID(Record[1]); in parseTypeTableBody()
2700 bool Scalable = Record.size() > 2 ? Record[2] : false; in parseTypeTableBody()
2701 ContainedIDs.push_back(Record[1]); in parseTypeTableBody()
2702 ResultTy = VectorType::get(ResultTy, Record[0], Scalable); in parseTypeTableBody()
2726 SmallVector<uint64_t, 64> Record; in parseOperandBundleTags() local
2740 case BitstreamEntry::Record: in parseOperandBundleTags()
2747 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseOperandBundleTags()
2751 return error("Invalid operand bundle record"); in parseOperandBundleTags()
2755 if (convertToString(Record, 0, BundleTags.back())) in parseOperandBundleTags()
2756 return error("Invalid operand bundle record"); in parseOperandBundleTags()
2757 Record.clear(); in parseOperandBundleTags()
2768 SmallVector<uint64_t, 64> Record; in parseSyncScopeNames() local
2783 case BitstreamEntry::Record: in parseSyncScopeNames()
2791 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseSyncScopeNames()
2795 return error("Invalid sync scope record"); in parseSyncScopeNames()
2798 if (convertToString(Record, 0, SSN)) in parseSyncScopeNames()
2799 return error("Invalid sync scope record"); in parseSyncScopeNames()
2802 Record.clear(); in parseSyncScopeNames()
2806 /// Associate a value with its name from the given index in the provided record.
2807 Expected<Value *> BitcodeReader::recordValue(SmallVectorImpl<uint64_t> &Record, in recordValue() argument
2810 if (convertToString(Record, NameIndex, ValueName)) in recordValue()
2811 return error("Invalid record"); in recordValue()
2812 unsigned ValueID = Record[0]; in recordValue()
2814 return error("Invalid record"); in recordValue()
2847 ArrayRef<uint64_t> Record) { in setDeferredFunctionInfo() argument
2851 uint64_t FuncWordOffset = Record[1] - 1; in setDeferredFunctionInfo()
2869 SmallVector<uint64_t, 64> Record; in parseGlobalValueSymbolTable() local
2882 case BitstreamEntry::Record: in parseGlobalValueSymbolTable()
2886 Record.clear(); in parseGlobalValueSymbolTable()
2887 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseGlobalValueSymbolTable()
2892 unsigned ValueID = Record[0]; in parseGlobalValueSymbolTable()
2896 cast<Function>(ValueList[ValueID]), Record); in parseGlobalValueSymbolTable()
2944 SmallVector<uint64_t, 64> Record; in parseValueSymbolTable() local
2966 case BitstreamEntry::Record: in parseValueSymbolTable()
2971 // Read a record. in parseValueSymbolTable()
2972 Record.clear(); in parseValueSymbolTable()
2973 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseValueSymbolTable()
2980 Expected<Value *> ValOrErr = recordValue(Record, 1, TT); in parseValueSymbolTable()
2988 Expected<Value *> ValOrErr = recordValue(Record, 2, TT); in parseValueSymbolTable()
2996 setDeferredFunctionInfo(FuncBitcodeOffsetDelta, F, Record); in parseValueSymbolTable()
3000 if (convertToString(Record, 1, ValueName)) in parseValueSymbolTable()
3001 return error("Invalid bbentry record"); in parseValueSymbolTable()
3002 BasicBlock *BB = getBasicBlock(Record[0]); in parseValueSymbolTable()
3004 return error("Invalid bbentry record"); in parseValueSymbolTable()
3124 SmallVector<uint64_t, 64> Record; in parseConstants() local
3147 case BitstreamEntry::Record: in parseConstants()
3152 // Read a record. in parseConstants()
3153 Record.clear(); in parseConstants()
3156 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in parseConstants()
3168 if (Record.empty()) in parseConstants()
3169 return error("Invalid settype record"); in parseConstants()
3170 if (Record[0] >= TypeList.size() || !TypeList[Record[0]]) in parseConstants()
3171 return error("Invalid settype record"); in parseConstants()
3172 if (TypeList[Record[0]] == VoidType) in parseConstants()
3174 CurTyID = Record[0]; in parseConstants()
3187 if (!CurTy->isIntOrIntVectorTy() || Record.empty()) in parseConstants()
3188 return error("Invalid integer const record"); in parseConstants()
3189 V = ConstantInt::get(CurTy, decodeSignRotatedValue(Record[0])); in parseConstants()
3192 if (!CurTy->isIntOrIntVectorTy() || Record.empty()) in parseConstants()
3193 return error("Invalid wide integer const record"); in parseConstants()
3196 APInt VInt = readWideAPInt(Record, ScalarTy->getBitWidth()); in parseConstants()
3201 if (Record.empty()) in parseConstants()
3202 return error("Invalid float const record"); in parseConstants()
3207 APInt(16, (uint16_t)Record[0]))); in parseConstants()
3210 CurTy, APFloat(APFloat::BFloat(), APInt(16, (uint32_t)Record[0]))); in parseConstants()
3213 APInt(32, (uint32_t)Record[0]))); in parseConstants()
3216 CurTy, APFloat(APFloat::IEEEdouble(), APInt(64, Record[0]))); in parseConstants()
3220 Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16); in parseConstants()
3221 Rearrange[1] = Record[0] >> 48; in parseConstants()
3226 APFloat(APFloat::IEEEquad(), APInt(128, Record))); in parseConstants()
3229 CurTy, APFloat(APFloat::PPCDoubleDouble(), APInt(128, Record))); in parseConstants()
3236 if (Record.empty()) in parseConstants()
3237 return error("Invalid aggregate record"); in parseConstants()
3239 unsigned Size = Record.size(); in parseConstants()
3242 Elts.push_back(Record[i]); in parseConstants()
3260 if (Record.empty()) in parseConstants()
3261 return error("Invalid string record"); in parseConstants()
3263 SmallString<16> Elts(Record.begin(), Record.end()); in parseConstants()
3269 if (Record.empty()) in parseConstants()
3270 return error("Invalid data record"); in parseConstants()
3278 SmallVector<uint8_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3284 SmallVector<uint16_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3290 SmallVector<uint32_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3296 SmallVector<uint64_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3302 SmallVector<uint16_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3308 SmallVector<uint16_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3314 SmallVector<uint32_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3320 SmallVector<uint64_t, 16> Elts(Record.begin(), Record.end()); in parseConstants()
3331 if (Record.size() < 2) in parseConstants()
3332 return error("Invalid unary op constexpr record"); in parseConstants()
3333 int Opc = getDecodedUnaryOpcode(Record[0], CurTy); in parseConstants()
3337 V = BitcodeConstant::create(Alloc, CurTy, Opc, (unsigned)Record[1]); in parseConstants()
3342 if (Record.size() < 3) in parseConstants()
3343 return error("Invalid binary op constexpr record"); in parseConstants()
3344 int Opc = getDecodedBinaryOpcode(Record[0], CurTy); in parseConstants()
3349 if (Record.size() >= 4) { in parseConstants()
3354 if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP)) in parseConstants()
3356 if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) in parseConstants()
3362 if (Record[3] & (1 << bitc::PEO_EXACT)) in parseConstants()
3367 {(unsigned)Record[1], (unsigned)Record[2]}); in parseConstants()
3372 if (Record.size() < 3) in parseConstants()
3373 return error("Invalid cast constexpr record"); in parseConstants()
3374 int Opc = getDecodedCastOpcode(Record[0]); in parseConstants()
3378 unsigned OpTyID = Record[1]; in parseConstants()
3381 return error("Invalid cast constexpr record"); in parseConstants()
3382 V = BitcodeConstant::create(Alloc, CurTy, Opc, (unsigned)Record[2]); in parseConstants()
3393 if (Record.size() < 2) in parseConstants()
3394 return error("Constant GEP record must have at least two elements"); in parseConstants()
3399 BitCode == bitc::CST_CODE_CE_GEP || Record.size() % 2) in parseConstants()
3400 PointeeType = getTypeByID(Record[OpNum++]); in parseConstants()
3405 uint64_t Op = Record[OpNum++]; in parseConstants()
3412 Flags = Record[OpNum++]; in parseConstants()
3414 readBitWidthAndConstantRange(Record, OpNum); in parseConstants()
3419 Flags = Record[OpNum++]; in parseConstants()
3424 unsigned BaseTypeID = Record[OpNum]; in parseConstants()
3425 while (OpNum != Record.size()) { in parseConstants()
3426 unsigned ElTyID = Record[OpNum++]; in parseConstants()
3429 return error("Invalid getelementptr constexpr record"); in parseConstants()
3430 Elts.push_back(Record[OpNum++]); in parseConstants()
3459 if (Record.size() < 3) in parseConstants()
3460 return error("Invalid select constexpr record"); in parseConstants()
3464 {(unsigned)Record[0], (unsigned)Record[1], (unsigned)Record[2]}); in parseConstants()
3469 if (Record.size() < 3) in parseConstants()
3470 return error("Invalid extractelement constexpr record"); in parseConstants()
3471 unsigned OpTyID = Record[0]; in parseConstants()
3475 return error("Invalid extractelement constexpr record"); in parseConstants()
3477 if (Record.size() == 4) { in parseConstants()
3478 unsigned IdxTyID = Record[2]; in parseConstants()
3481 return error("Invalid extractelement constexpr record"); in parseConstants()
3482 IdxRecord = Record[3]; in parseConstants()
3485 IdxRecord = Record[2]; in parseConstants()
3488 {(unsigned)Record[1], IdxRecord}); in parseConstants()
3494 if (Record.size() < 3 || !OpTy) in parseConstants()
3495 return error("Invalid insertelement constexpr record"); in parseConstants()
3497 if (Record.size() == 4) { in parseConstants()
3498 unsigned IdxTyID = Record[2]; in parseConstants()
3501 return error("Invalid insertelement constexpr record"); in parseConstants()
3502 IdxRecord = Record[3]; in parseConstants()
3505 IdxRecord = Record[2]; in parseConstants()
3509 {(unsigned)Record[0], (unsigned)Record[1], IdxRecord}); in parseConstants()
3514 if (Record.size() < 3 || !OpTy) in parseConstants()
3515 return error("Invalid shufflevector constexpr record"); in parseConstants()
3518 {(unsigned)Record[0], (unsigned)Record[1], (unsigned)Record[2]}); in parseConstants()
3524 dyn_cast_or_null<VectorType>(getTypeByID(Record[0])); in parseConstants()
3525 if (Record.size() < 4 || !RTy || !OpTy) in parseConstants()
3526 return error("Invalid shufflevector constexpr record"); in parseConstants()
3529 {(unsigned)Record[1], (unsigned)Record[2], (unsigned)Record[3]}); in parseConstants()
3533 if (Record.size() < 4) in parseConstants()
3534 return error("Invalid cmp constexpt record"); in parseConstants()
3535 unsigned OpTyID = Record[0]; in parseConstants()
3538 return error("Invalid cmp constexpr record"); in parseConstants()
3543 (uint8_t)Record[3]}, in parseConstants()
3544 {(unsigned)Record[1], (unsigned)Record[2]}); in parseConstants()
3550 if (Record.size() < 2) in parseConstants()
3551 return error("Invalid inlineasm record"); in parseConstants()
3553 bool HasSideEffects = Record[0] & 1; in parseConstants()
3554 bool IsAlignStack = Record[0] >> 1; in parseConstants()
3555 unsigned AsmStrSize = Record[1]; in parseConstants()
3556 if (2+AsmStrSize >= Record.size()) in parseConstants()
3557 return error("Invalid inlineasm record"); in parseConstants()
3558 unsigned ConstStrSize = Record[2+AsmStrSize]; in parseConstants()
3559 if (3+AsmStrSize+ConstStrSize > Record.size()) in parseConstants()
3560 return error("Invalid inlineasm record"); in parseConstants()
3563 AsmStr += (char)Record[2+i]; in parseConstants()
3565 ConstrStr += (char)Record[3+AsmStrSize+i]; in parseConstants()
3576 if (Record.size() < 2) in parseConstants()
3577 return error("Invalid inlineasm record"); in parseConstants()
3579 bool HasSideEffects = Record[0] & 1; in parseConstants()
3580 bool IsAlignStack = (Record[0] >> 1) & 1; in parseConstants()
3581 unsigned AsmDialect = Record[0] >> 2; in parseConstants()
3582 unsigned AsmStrSize = Record[1]; in parseConstants()
3583 if (2+AsmStrSize >= Record.size()) in parseConstants()
3584 return error("Invalid inlineasm record"); in parseConstants()
3585 unsigned ConstStrSize = Record[2+AsmStrSize]; in parseConstants()
3586 if (3+AsmStrSize+ConstStrSize > Record.size()) in parseConstants()
3587 return error("Invalid inlineasm record"); in parseConstants()
3590 AsmStr += (char)Record[2+i]; in parseConstants()
3592 ConstrStr += (char)Record[3+AsmStrSize+i]; in parseConstants()
3603 if (Record.size() < 2) in parseConstants()
3604 return error("Invalid inlineasm record"); in parseConstants()
3607 bool HasSideEffects = Record[OpNum] & 1; in parseConstants()
3608 bool IsAlignStack = (Record[OpNum] >> 1) & 1; in parseConstants()
3609 unsigned AsmDialect = (Record[OpNum] >> 2) & 1; in parseConstants()
3610 bool CanThrow = (Record[OpNum] >> 3) & 1; in parseConstants()
3612 unsigned AsmStrSize = Record[OpNum]; in parseConstants()
3614 if (OpNum + AsmStrSize >= Record.size()) in parseConstants()
3615 return error("Invalid inlineasm record"); in parseConstants()
3616 unsigned ConstStrSize = Record[OpNum + AsmStrSize]; in parseConstants()
3617 if (OpNum + 1 + AsmStrSize + ConstStrSize > Record.size()) in parseConstants()
3618 return error("Invalid inlineasm record"); in parseConstants()
3621 AsmStr += (char)Record[OpNum + i]; in parseConstants()
3624 ConstrStr += (char)Record[OpNum + AsmStrSize + i]; in parseConstants()
3635 if (Record.size() < 3) in parseConstants()
3636 return error("Invalid inlineasm record"); in parseConstants()
3638 auto *FnTy = dyn_cast_or_null<FunctionType>(getTypeByID(Record[OpNum])); in parseConstants()
3641 return error("Invalid inlineasm record"); in parseConstants()
3643 bool HasSideEffects = Record[OpNum] & 1; in parseConstants()
3644 bool IsAlignStack = (Record[OpNum] >> 1) & 1; in parseConstants()
3645 unsigned AsmDialect = (Record[OpNum] >> 2) & 1; in parseConstants()
3646 bool CanThrow = (Record[OpNum] >> 3) & 1; in parseConstants()
3648 unsigned AsmStrSize = Record[OpNum]; in parseConstants()
3650 if (OpNum + AsmStrSize >= Record.size()) in parseConstants()
3651 return error("Invalid inlineasm record"); in parseConstants()
3652 unsigned ConstStrSize = Record[OpNum + AsmStrSize]; in parseConstants()
3653 if (OpNum + 1 + AsmStrSize + ConstStrSize > Record.size()) in parseConstants()
3654 return error("Invalid inlineasm record"); in parseConstants()
3657 AsmStr += (char)Record[OpNum + i]; in parseConstants()
3660 ConstrStr += (char)Record[OpNum + AsmStrSize + i]; in parseConstants()
3667 if (Record.size() < 3) in parseConstants()
3668 return error("Invalid blockaddress record"); in parseConstants()
3669 unsigned FnTyID = Record[0]; in parseConstants()
3672 return error("Invalid blockaddress record"); in parseConstants()
3675 {BitcodeConstant::BlockAddressOpcode, 0, (unsigned)Record[2]}, in parseConstants()
3676 Record[1]); in parseConstants()
3680 if (Record.size() < 2) in parseConstants()
3681 return error("Invalid dso_local record"); in parseConstants()
3682 unsigned GVTyID = Record[0]; in parseConstants()
3685 return error("Invalid dso_local record"); in parseConstants()
3687 Alloc, CurTy, BitcodeConstant::DSOLocalEquivalentOpcode, Record[1]); in parseConstants()
3691 if (Record.size() < 2) in parseConstants()
3692 return error("Invalid no_cfi record"); in parseConstants()
3693 unsigned GVTyID = Record[0]; in parseConstants()
3696 return error("Invalid no_cfi record"); in parseConstants()
3698 Record[1]); in parseConstants()
3702 if (Record.size() < 4) in parseConstants()
3703 return error("Invalid ptrauth record"); in parseConstants()
3707 {(unsigned)Record[0], (unsigned)Record[1], in parseConstants()
3708 (unsigned)Record[2], (unsigned)Record[3]}); in parseConstants()
3725 SmallVector<uint64_t, 64> Record; in parseUseLists() local
3739 case BitstreamEntry::Record: in parseUseLists()
3744 // Read a use list record. in parseUseLists()
3745 Record.clear(); in parseUseLists()
3747 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseUseLists()
3757 unsigned RecordLength = Record.size(); in parseUseLists()
3760 return error("Invalid record"); in parseUseLists()
3761 unsigned ID = Record.pop_back_val(); in parseUseLists()
3772 if (++NumUses > Record.size()) in parseUseLists()
3774 Order[&U] = Record[NumUses - 1]; in parseUseLists()
3776 if (Order.size() != Record.size() || NumUses > Record.size()) in parseUseLists()
3893 /// either have an old bitcode file without a VST forward declaration record,
3910 SmallVector<uint64_t, 64> Record; in rememberAndSkipFunctionBodies() local
3948 Error BitcodeReader::parseComdatRecord(ArrayRef<uint64_t> Record) { in parseComdatRecord() argument
3952 std::tie(Name, Record) = readNameFromStrtab(Record); in parseComdatRecord()
3954 if (Record.empty()) in parseComdatRecord()
3955 return error("Invalid record"); in parseComdatRecord()
3956 Comdat::SelectionKind SK = getDecodedComdatSelectionKind(Record[0]); in parseComdatRecord()
3959 if (Record.size() < 2) in parseComdatRecord()
3960 return error("Invalid record"); in parseComdatRecord()
3961 unsigned ComdatNameSize = Record[1]; in parseComdatRecord()
3962 if (ComdatNameSize > Record.size() - 2) in parseComdatRecord()
3966 OldFormatName += (char)Record[2 + i]; in parseComdatRecord()
3995 Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) { in parseGlobalVarRecord() argument
4003 std::tie(Name, Record) = readNameFromStrtab(Record); in parseGlobalVarRecord()
4005 if (Record.size() < 6) in parseGlobalVarRecord()
4006 return error("Invalid record"); in parseGlobalVarRecord()
4007 unsigned TyID = Record[0]; in parseGlobalVarRecord()
4010 return error("Invalid record"); in parseGlobalVarRecord()
4011 bool isConstant = Record[1] & 1; in parseGlobalVarRecord()
4012 bool explicitType = Record[1] & 2; in parseGlobalVarRecord()
4015 AddressSpace = Record[1] >> 2; in parseGlobalVarRecord()
4026 uint64_t RawLinkage = Record[3]; in parseGlobalVarRecord()
4029 if (Error Err = parseAlignmentValue(Record[4], Alignment)) in parseGlobalVarRecord()
4032 if (Record[5]) { in parseGlobalVarRecord()
4033 if (Record[5] - 1 >= SectionTable.size()) in parseGlobalVarRecord()
4035 Section = SectionTable[Record[5] - 1]; in parseGlobalVarRecord()
4040 if (Record.size() > 6 && !GlobalValue::isLocalLinkage(Linkage)) in parseGlobalVarRecord()
4041 Visibility = getDecodedVisibility(Record[6]); in parseGlobalVarRecord()
4044 if (Record.size() > 7) in parseGlobalVarRecord()
4045 TLM = getDecodedThreadLocalMode(Record[7]); in parseGlobalVarRecord()
4048 if (Record.size() > 8) in parseGlobalVarRecord()
4049 UnnamedAddr = getDecodedUnnamedAddrType(Record[8]); in parseGlobalVarRecord()
4052 if (Record.size() > 9) in parseGlobalVarRecord()
4053 ExternallyInitialized = Record[9]; in parseGlobalVarRecord()
4065 if (Record.size() > 10) { in parseGlobalVarRecord()
4068 NewGV->setDLLStorageClass(getDecodedDLLStorageClass(Record[10])); in parseGlobalVarRecord()
4077 if (unsigned InitID = Record[2]) in parseGlobalVarRecord()
4080 if (Record.size() > 11) { in parseGlobalVarRecord()
4081 if (unsigned ComdatID = Record[11]) { in parseGlobalVarRecord()
4090 if (Record.size() > 12) { in parseGlobalVarRecord()
4091 auto AS = getAttributes(Record[12]).getFnAttrs(); in parseGlobalVarRecord()
4095 if (Record.size() > 13) { in parseGlobalVarRecord()
4096 NewGV->setDSOLocal(getDecodedDSOLocal(Record[13])); in parseGlobalVarRecord()
4101 if (Record.size() > 15) in parseGlobalVarRecord()
4102 NewGV->setPartition(StringRef(Strtab.data() + Record[14], Record[15])); in parseGlobalVarRecord()
4104 if (Record.size() > 16 && Record[16]) { in parseGlobalVarRecord()
4106 deserializeSanitizerMetadata(Record[16]); in parseGlobalVarRecord()
4110 if (Record.size() > 17 && Record[17]) { in parseGlobalVarRecord()
4111 if (auto CM = getDecodedCodeModel(Record[17])) in parseGlobalVarRecord()
4128 Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) { in parseFunctionRecord() argument
4134 std::tie(Name, Record) = readNameFromStrtab(Record); in parseFunctionRecord()
4136 if (Record.size() < 8) in parseFunctionRecord()
4137 return error("Invalid record"); in parseFunctionRecord()
4138 unsigned FTyID = Record[0]; in parseFunctionRecord()
4141 return error("Invalid record"); in parseFunctionRecord()
4151 auto CC = static_cast<CallingConv::ID>(Record[1]); in parseFunctionRecord()
4156 if (Record.size() > 16) in parseFunctionRecord()
4157 AddrSpace = Record[16]; in parseFunctionRecord()
4168 bool isProto = Record[2]; in parseFunctionRecord()
4169 uint64_t RawLinkage = Record[3]; in parseFunctionRecord()
4171 Func->setAttributes(getAttributes(Record[4])); in parseFunctionRecord()
4223 if (Error Err = parseAlignmentValue(Record[5], Alignment)) in parseFunctionRecord()
4227 if (Record[6]) { in parseFunctionRecord()
4228 if (Record[6] - 1 >= SectionTable.size()) in parseFunctionRecord()
4230 Func->setSection(SectionTable[Record[6] - 1]); in parseFunctionRecord()
4235 Func->setVisibility(getDecodedVisibility(Record[7])); in parseFunctionRecord()
4236 if (Record.size() > 8 && Record[8]) { in parseFunctionRecord()
4237 if (Record[8] - 1 >= GCTable.size()) in parseFunctionRecord()
4239 Func->setGC(GCTable[Record[8] - 1]); in parseFunctionRecord()
4242 if (Record.size() > 9) in parseFunctionRecord()
4243 UnnamedAddr = getDecodedUnnamedAddrType(Record[9]); in parseFunctionRecord()
4247 if (Record.size() > 10) in parseFunctionRecord()
4248 OperandInfo.Prologue = Record[10]; in parseFunctionRecord()
4250 if (Record.size() > 11) { in parseFunctionRecord()
4253 Func->setDLLStorageClass(getDecodedDLLStorageClass(Record[11])); in parseFunctionRecord()
4259 if (Record.size() > 12) { in parseFunctionRecord()
4260 if (unsigned ComdatID = Record[12]) { in parseFunctionRecord()
4269 if (Record.size() > 13) in parseFunctionRecord()
4270 OperandInfo.Prefix = Record[13]; in parseFunctionRecord()
4272 if (Record.size() > 14) in parseFunctionRecord()
4273 OperandInfo.PersonalityFn = Record[14]; in parseFunctionRecord()
4275 if (Record.size() > 15) { in parseFunctionRecord()
4276 Func->setDSOLocal(getDecodedDSOLocal(Record[15])); in parseFunctionRecord()
4280 // Record[16] is the address space number. in parseFunctionRecord()
4284 if (Record.size() > 18 && Strtab.data() && in parseFunctionRecord()
4285 Record[17] + Record[18] <= Strtab.size()) { in parseFunctionRecord()
4286 Func->setPartition(StringRef(Strtab.data() + Record[17], Record[18])); in parseFunctionRecord()
4305 unsigned BitCode, ArrayRef<uint64_t> Record) { in parseGlobalIndirectSymbolRecord() argument
4315 std::tie(Name, Record) = readNameFromStrtab(Record); in parseGlobalIndirectSymbolRecord()
4318 if (Record.size() < (3 + (unsigned)NewRecord)) in parseGlobalIndirectSymbolRecord()
4319 return error("Invalid record"); in parseGlobalIndirectSymbolRecord()
4321 unsigned TypeID = Record[OpNum++]; in parseGlobalIndirectSymbolRecord()
4324 return error("Invalid record"); in parseGlobalIndirectSymbolRecord()
4337 AddrSpace = Record[OpNum++]; in parseGlobalIndirectSymbolRecord()
4340 auto Val = Record[OpNum++]; in parseGlobalIndirectSymbolRecord()
4341 auto Linkage = Record[OpNum++]; in parseGlobalIndirectSymbolRecord()
4353 if (OpNum != Record.size()) { in parseGlobalIndirectSymbolRecord()
4356 NewGA->setVisibility(getDecodedVisibility(Record[VisInd])); in parseGlobalIndirectSymbolRecord()
4360 if (OpNum != Record.size()) { in parseGlobalIndirectSymbolRecord()
4361 auto S = Record[OpNum++]; in parseGlobalIndirectSymbolRecord()
4368 if (OpNum != Record.size()) in parseGlobalIndirectSymbolRecord()
4369 NewGA->setThreadLocalMode(getDecodedThreadLocalMode(Record[OpNum++])); in parseGlobalIndirectSymbolRecord()
4370 if (OpNum != Record.size()) in parseGlobalIndirectSymbolRecord()
4371 NewGA->setUnnamedAddr(getDecodedUnnamedAddrType(Record[OpNum++])); in parseGlobalIndirectSymbolRecord()
4373 if (OpNum != Record.size()) in parseGlobalIndirectSymbolRecord()
4374 NewGA->setDSOLocal(getDecodedDSOLocal(Record[OpNum++])); in parseGlobalIndirectSymbolRecord()
4378 if (OpNum + 1 < Record.size()) { in parseGlobalIndirectSymbolRecord()
4380 if (Record[OpNum] + Record[OpNum + 1] > Strtab.size()) in parseGlobalIndirectSymbolRecord()
4383 StringRef(Strtab.data() + Record[OpNum], Record[OpNum + 1])); in parseGlobalIndirectSymbolRecord()
4410 SmallVector<uint64_t, 64> Record; in parseModule() local
4488 // associated VST forward declaration record (which would have caused in parseModule()
4497 // We must have had a VST forward declaration record, which caused in parseModule()
4538 // If we have a VST forward declaration record, make sure we in parseModule()
4545 // Fall through so that we record the NextUnreadBit below. in parseModule()
4550 // If we have a VST forward declaration record, but have already in parseModule()
4563 // index in the VST, nor a VST forward declaration record, as in parseModule()
4595 case BitstreamEntry::Record: in parseModule()
4600 // Read a record. in parseModule()
4601 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in parseModule()
4607 Expected<unsigned> VersionOrErr = parseVersionRecord(Record); in parseModule()
4617 if (convertToString(Record, 0, S)) in parseModule()
4618 return error("Invalid record"); in parseModule()
4625 if (convertToString(Record, 0, TentativeDataLayoutStr)) in parseModule()
4626 return error("Invalid record"); in parseModule()
4631 if (convertToString(Record, 0, S)) in parseModule()
4632 return error("Invalid record"); in parseModule()
4639 if (convertToString(Record, 0, S)) in parseModule()
4640 return error("Invalid record"); in parseModule()
4646 if (convertToString(Record, 0, S)) in parseModule()
4647 return error("Invalid record"); in parseModule()
4653 if (convertToString(Record, 0, S)) in parseModule()
4654 return error("Invalid record"); in parseModule()
4659 if (Error Err = parseComdatRecord(Record)) in parseModule()
4665 // record in parseModule()
4668 if (Error Err = parseGlobalVarRecord(Record)) in parseModule()
4674 if (Error Err = parseFunctionRecord(Record)) in parseModule()
4680 if (Error Err = parseGlobalIndirectSymbolRecord(BitCode, Record)) in parseModule()
4685 if (Record.empty()) in parseModule()
4686 return error("Invalid record"); in parseModule()
4690 VSTOffset = Record[0] - 1; in parseModule()
4695 if (convertToString(Record, 0, ValueName)) in parseModule()
4696 return error("Invalid record"); in parseModule()
4700 Record.clear(); in parseModule()
4867 SmallVector<uint64_t, 64> Record; in parseFunctionBody() local
4913 case BitstreamEntry::Record: in parseFunctionBody()
4918 // Read a record. in parseFunctionBody()
4919 Record.clear(); in parseFunctionBody()
4922 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in parseFunctionBody()
4929 if (Record.empty() || Record[0] == 0) in parseFunctionBody()
4930 return error("Invalid record"); in parseFunctionBody()
4932 FunctionBBs.resize(Record[0]); in parseFunctionBody()
4964 // The record should not be emitted if it's an empty list. in parseFunctionBody()
4965 if (Record.empty()) in parseFunctionBody()
4966 return error("Invalid record"); in parseFunctionBody()
4980 for (uint64_t ValID : Record) in parseFunctionBody()
4984 return error("Invalid record"); in parseFunctionBody()
4989 // This record indicates that the last instruction is at the same in parseFunctionBody()
4994 return error("Invalid record"); in parseFunctionBody()
5001 if (!I || Record.size() < 4) in parseFunctionBody()
5002 return error("Invalid record"); in parseFunctionBody()
5004 unsigned Line = Record[0], Col = Record[1]; in parseFunctionBody()
5005 unsigned ScopeID = Record[2], IAID = Record[3]; in parseFunctionBody()
5006 bool isImplicitCode = Record.size() == 5 && Record[4]; in parseFunctionBody()
5013 return error("Invalid record"); in parseFunctionBody()
5019 return error("Invalid record"); in parseFunctionBody()
5031 if (getValueTypePair(Record, OpNum, NextValueNo, LHS, TypeID, CurBB) || in parseFunctionBody()
5032 OpNum+1 > Record.size()) in parseFunctionBody()
5033 return error("Invalid record"); in parseFunctionBody()
5035 int Opc = getDecodedUnaryOpcode(Record[OpNum++], LHS->getType()); in parseFunctionBody()
5037 return error("Invalid record"); in parseFunctionBody()
5041 if (OpNum < Record.size()) { in parseFunctionBody()
5043 FastMathFlags FMF = getDecodedFastMathFlags(Record[OpNum]); in parseFunctionBody()
5054 if (getValueTypePair(Record, OpNum, NextValueNo, LHS, TypeID, CurBB) || in parseFunctionBody()
5055 popValue(Record, OpNum, NextValueNo, LHS->getType(), TypeID, RHS, in parseFunctionBody()
5057 OpNum+1 > Record.size()) in parseFunctionBody()
5058 return error("Invalid record"); in parseFunctionBody()
5060 int Opc = getDecodedBinaryOpcode(Record[OpNum++], LHS->getType()); in parseFunctionBody()
5062 return error("Invalid record"); in parseFunctionBody()
5066 if (OpNum < Record.size()) { in parseFunctionBody()
5071 if (Record[OpNum] & (1 << bitc::OBO_NO_SIGNED_WRAP)) in parseFunctionBody()
5073 if (Record[OpNum] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) in parseFunctionBody()
5079 if (Record[OpNum] & (1 << bitc::PEO_EXACT)) in parseFunctionBody()
5082 if (Record[OpNum] & (1 << bitc::PDI_DISJOINT)) in parseFunctionBody()
5085 FastMathFlags FMF = getDecodedFastMathFlags(Record[OpNum]); in parseFunctionBody()
5096 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB) || in parseFunctionBody()
5097 OpNum + 1 > Record.size()) in parseFunctionBody()
5098 return error("Invalid record"); in parseFunctionBody()
5100 ResTypeID = Record[OpNum++]; in parseFunctionBody()
5102 int Opc = getDecodedCastOpcode(Record[OpNum++]); in parseFunctionBody()
5105 return error("Invalid record"); in parseFunctionBody()
5120 if (OpNum < Record.size()) { in parseFunctionBody()
5122 if (Record[OpNum] & (1 << bitc::PNNI_NON_NEG)) in parseFunctionBody()
5125 if (Record[OpNum] & (1 << bitc::TIO_NO_UNSIGNED_WRAP)) in parseFunctionBody()
5127 if (Record[OpNum] & (1 << bitc::TIO_NO_SIGNED_WRAP)) in parseFunctionBody()
5145 NW = toGEPNoWrapFlags(Record[OpNum++]); in parseFunctionBody()
5146 TyID = Record[OpNum++]; in parseFunctionBody()
5157 if (getValueTypePair(Record, OpNum, NextValueNo, BasePtr, BasePtrTypeID, in parseFunctionBody()
5159 return error("Invalid record"); in parseFunctionBody()
5169 while (OpNum != Record.size()) { in parseFunctionBody()
5172 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
5173 return error("Invalid record"); in parseFunctionBody()
5213 if (getValueTypePair(Record, OpNum, NextValueNo, Agg, AggTypeID, CurBB)) in parseFunctionBody()
5214 return error("Invalid record"); in parseFunctionBody()
5217 unsigned RecSize = Record.size(); in parseFunctionBody()
5226 uint64_t Index = Record[OpNum]; in parseFunctionBody()
5257 if (getValueTypePair(Record, OpNum, NextValueNo, Agg, AggTypeID, CurBB)) in parseFunctionBody()
5258 return error("Invalid record"); in parseFunctionBody()
5261 if (getValueTypePair(Record, OpNum, NextValueNo, Val, ValTypeID, CurBB)) in parseFunctionBody()
5262 return error("Invalid record"); in parseFunctionBody()
5264 unsigned RecSize = Record.size(); in parseFunctionBody()
5273 uint64_t Index = Record[OpNum]; in parseFunctionBody()
5307 if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal, TypeID, in parseFunctionBody()
5309 popValue(Record, OpNum, NextValueNo, TrueVal->getType(), TypeID, in parseFunctionBody()
5311 popValue(Record, OpNum, NextValueNo, CondType, in parseFunctionBody()
5313 return error("Invalid record"); in parseFunctionBody()
5327 if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal, ValTypeID, in parseFunctionBody()
5329 popValue(Record, OpNum, NextValueNo, TrueVal->getType(), ValTypeID, in parseFunctionBody()
5331 getValueTypePair(Record, OpNum, NextValueNo, Cond, CondTypeID, CurBB)) in parseFunctionBody()
5332 return error("Invalid record"); in parseFunctionBody()
5349 if (OpNum < Record.size() && isa<FPMathOperator>(I)) { in parseFunctionBody()
5350 FastMathFlags FMF = getDecodedFastMathFlags(Record[OpNum]); in parseFunctionBody()
5361 if (getValueTypePair(Record, OpNum, NextValueNo, Vec, VecTypeID, CurBB) || in parseFunctionBody()
5362 getValueTypePair(Record, OpNum, NextValueNo, Idx, IdxTypeID, CurBB)) in parseFunctionBody()
5363 return error("Invalid record"); in parseFunctionBody()
5376 if (getValueTypePair(Record, OpNum, NextValueNo, Vec, VecTypeID, CurBB)) in parseFunctionBody()
5377 return error("Invalid record"); in parseFunctionBody()
5380 if (popValue(Record, OpNum, NextValueNo, in parseFunctionBody()
5383 getValueTypePair(Record, OpNum, NextValueNo, Idx, IdxTypeID, CurBB)) in parseFunctionBody()
5384 return error("Invalid record"); in parseFunctionBody()
5395 if (getValueTypePair(Record, OpNum, NextValueNo, Vec1, Vec1TypeID, in parseFunctionBody()
5397 popValue(Record, OpNum, NextValueNo, Vec1->getType(), Vec1TypeID, in parseFunctionBody()
5399 return error("Invalid record"); in parseFunctionBody()
5402 if (getValueTypePair(Record, OpNum, NextValueNo, Mask, MaskTypeID, CurBB)) in parseFunctionBody()
5403 return error("Invalid record"); in parseFunctionBody()
5424 if (getValueTypePair(Record, OpNum, NextValueNo, LHS, LHSTypeID, CurBB) || in parseFunctionBody()
5425 popValue(Record, OpNum, NextValueNo, LHS->getType(), LHSTypeID, RHS, in parseFunctionBody()
5427 return error("Invalid record"); in parseFunctionBody()
5429 if (OpNum >= Record.size()) in parseFunctionBody()
5431 "Invalid record: operand number exceeded available operands"); in parseFunctionBody()
5433 CmpInst::Predicate PredVal = CmpInst::Predicate(Record[OpNum]); in parseFunctionBody()
5436 if (IsFP && Record.size() > OpNum+1) in parseFunctionBody()
5437 FMF = getDecodedFastMathFlags(Record[++OpNum]); in parseFunctionBody()
5439 if (OpNum+1 != Record.size()) in parseFunctionBody()
5440 return error("Invalid record"); in parseFunctionBody()
5464 unsigned Size = Record.size(); in parseFunctionBody()
5474 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
5475 return error("Invalid record"); in parseFunctionBody()
5476 if (OpNum != Record.size()) in parseFunctionBody()
5477 return error("Invalid record"); in parseFunctionBody()
5484 if (Record.size() != 1 && Record.size() != 3) in parseFunctionBody()
5485 return error("Invalid record"); in parseFunctionBody()
5486 BasicBlock *TrueDest = getBasicBlock(Record[0]); in parseFunctionBody()
5488 return error("Invalid record"); in parseFunctionBody()
5490 if (Record.size() == 1) { in parseFunctionBody()
5495 BasicBlock *FalseDest = getBasicBlock(Record[1]); in parseFunctionBody()
5497 Value *Cond = getValue(Record, 2, NextValueNo, CondType, in parseFunctionBody()
5500 return error("Invalid record"); in parseFunctionBody()
5507 if (Record.size() != 1 && Record.size() != 2) in parseFunctionBody()
5508 return error("Invalid record"); in parseFunctionBody()
5511 Value *CleanupPad = getValue(Record, Idx++, NextValueNo, TokenTy, in parseFunctionBody()
5514 return error("Invalid record"); in parseFunctionBody()
5516 if (Record.size() == 2) { in parseFunctionBody()
5517 UnwindDest = getBasicBlock(Record[Idx++]); in parseFunctionBody()
5519 return error("Invalid record"); in parseFunctionBody()
5527 if (Record.size() != 2) in parseFunctionBody()
5528 return error("Invalid record"); in parseFunctionBody()
5531 Value *CatchPad = getValue(Record, Idx++, NextValueNo, TokenTy, in parseFunctionBody()
5534 return error("Invalid record"); in parseFunctionBody()
5535 BasicBlock *BB = getBasicBlock(Record[Idx++]); in parseFunctionBody()
5537 return error("Invalid record"); in parseFunctionBody()
5545 if (Record.size() < 2) in parseFunctionBody()
5546 return error("Invalid record"); in parseFunctionBody()
5551 Value *ParentPad = getValue(Record, Idx++, NextValueNo, TokenTy, in parseFunctionBody()
5554 return error("Invalid record"); in parseFunctionBody()
5556 unsigned NumHandlers = Record[Idx++]; in parseFunctionBody()
5560 BasicBlock *BB = getBasicBlock(Record[Idx++]); in parseFunctionBody()
5562 return error("Invalid record"); in parseFunctionBody()
5567 if (Idx + 1 == Record.size()) { in parseFunctionBody()
5568 UnwindDest = getBasicBlock(Record[Idx++]); in parseFunctionBody()
5570 return error("Invalid record"); in parseFunctionBody()
5573 if (Record.size() != Idx) in parseFunctionBody()
5574 return error("Invalid record"); in parseFunctionBody()
5588 if (Record.size() < 2) in parseFunctionBody()
5589 return error("Invalid record"); in parseFunctionBody()
5594 Value *ParentPad = getValue(Record, Idx++, NextValueNo, TokenTy, in parseFunctionBody()
5597 return error("Invald record"); in parseFunctionBody()
5599 unsigned NumArgOperands = Record[Idx++]; in parseFunctionBody()
5605 if (getValueTypePair(Record, Idx, NextValueNo, Val, ValTypeID, nullptr)) in parseFunctionBody()
5606 return error("Invalid record"); in parseFunctionBody()
5610 if (Record.size() != Idx) in parseFunctionBody()
5611 return error("Invalid record"); in parseFunctionBody()
5623 if ((Record[0] >> 16) == SWITCH_INST_MAGIC) { in parseFunctionBody()
5629 unsigned OpTyID = Record[1]; in parseFunctionBody()
5633 Value *Cond = getValue(Record, 2, NextValueNo, OpTy, OpTyID, CurBB); in parseFunctionBody()
5634 BasicBlock *Default = getBasicBlock(Record[3]); in parseFunctionBody()
5636 return error("Invalid record"); in parseFunctionBody()
5638 unsigned NumCases = Record[4]; in parseFunctionBody()
5646 unsigned NumItems = Record[CurIdx++]; in parseFunctionBody()
5648 bool isSingleNumber = Record[CurIdx++]; in parseFunctionBody()
5653 ActiveWords = Record[CurIdx++]; in parseFunctionBody()
5654 Low = readWideAPInt(ArrayRef(&Record[CurIdx], ActiveWords), in parseFunctionBody()
5661 ActiveWords = Record[CurIdx++]; in parseFunctionBody()
5662 APInt High = readWideAPInt(ArrayRef(&Record[CurIdx], ActiveWords), in parseFunctionBody()
5675 BasicBlock *DestBB = getBasicBlock(Record[CurIdx++]); in parseFunctionBody()
5685 if (Record.size() < 3 || (Record.size() & 1) == 0) in parseFunctionBody()
5686 return error("Invalid record"); in parseFunctionBody()
5687 unsigned OpTyID = Record[0]; in parseFunctionBody()
5689 Value *Cond = getValue(Record, 1, NextValueNo, OpTy, OpTyID, CurBB); in parseFunctionBody()
5690 BasicBlock *Default = getBasicBlock(Record[2]); in parseFunctionBody()
5692 return error("Invalid record"); in parseFunctionBody()
5693 unsigned NumCases = (Record.size()-3)/2; in parseFunctionBody()
5698 getFnValueByID(Record[3+i*2], OpTy, OpTyID, nullptr)); in parseFunctionBody()
5699 BasicBlock *DestBB = getBasicBlock(Record[1+3+i*2]); in parseFunctionBody()
5702 return error("Invalid record"); in parseFunctionBody()
5710 if (Record.size() < 2) in parseFunctionBody()
5711 return error("Invalid record"); in parseFunctionBody()
5712 unsigned OpTyID = Record[0]; in parseFunctionBody()
5714 Value *Address = getValue(Record, 1, NextValueNo, OpTy, OpTyID, CurBB); in parseFunctionBody()
5716 return error("Invalid record"); in parseFunctionBody()
5717 unsigned NumDests = Record.size()-2; in parseFunctionBody()
5721 if (BasicBlock *DestBB = getBasicBlock(Record[2+i])) { in parseFunctionBody()
5725 return error("Invalid record"); in parseFunctionBody()
5734 if (Record.size() < 4) in parseFunctionBody()
5735 return error("Invalid record"); in parseFunctionBody()
5737 AttributeList PAL = getAttributes(Record[OpNum++]); in parseFunctionBody()
5738 unsigned CCInfo = Record[OpNum++]; in parseFunctionBody()
5739 BasicBlock *NormalBB = getBasicBlock(Record[OpNum++]); in parseFunctionBody()
5740 BasicBlock *UnwindBB = getBasicBlock(Record[OpNum++]); in parseFunctionBody()
5745 FTyID = Record[OpNum++]; in parseFunctionBody()
5753 if (getValueTypePair(Record, OpNum, NextValueNo, Callee, CalleeTypeID, in parseFunctionBody()
5755 return error("Invalid record"); in parseFunctionBody()
5766 if (Record.size() < FTy->getNumParams() + OpNum) in parseFunctionBody()
5773 Ops.push_back(getValue(Record, OpNum, NextValueNo, FTy->getParamType(i), in parseFunctionBody()
5777 return error("Invalid record"); in parseFunctionBody()
5781 if (Record.size() != OpNum) in parseFunctionBody()
5782 return error("Invalid record"); in parseFunctionBody()
5785 while (OpNum != Record.size()) { in parseFunctionBody()
5788 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
5789 return error("Invalid record"); in parseFunctionBody()
5818 if (getValueTypePair(Record, Idx, NextValueNo, Val, ValTypeID, CurBB)) in parseFunctionBody()
5819 return error("Invalid record"); in parseFunctionBody()
5827 AttributeList PAL = getAttributes(Record[OpNum++]); in parseFunctionBody()
5828 unsigned CCInfo = Record[OpNum++]; in parseFunctionBody()
5830 BasicBlock *DefaultDest = getBasicBlock(Record[OpNum++]); in parseFunctionBody()
5831 unsigned NumIndirectDests = Record[OpNum++]; in parseFunctionBody()
5834 IndirectDests.push_back(getBasicBlock(Record[OpNum++])); in parseFunctionBody()
5839 FTyID = Record[OpNum++]; in parseFunctionBody()
5847 if (getValueTypePair(Record, OpNum, NextValueNo, Callee, CalleeTypeID, in parseFunctionBody()
5849 return error("Invalid record"); in parseFunctionBody()
5860 if (Record.size() < FTy->getNumParams() + OpNum) in parseFunctionBody()
5870 Arg = getBasicBlock(Record[OpNum]); in parseFunctionBody()
5872 Arg = getValue(Record, OpNum, NextValueNo, FTy->getParamType(i), in parseFunctionBody()
5875 return error("Invalid record"); in parseFunctionBody()
5882 if (OpNum != Record.size()) in parseFunctionBody()
5883 return error("Invalid record"); in parseFunctionBody()
5885 while (OpNum != Record.size()) { in parseFunctionBody()
5888 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
5889 return error("Invalid record"); in parseFunctionBody()
5973 if (Record.empty()) in parseFunctionBody()
5974 return error("Invalid phi record"); in parseFunctionBody()
5975 // The first record specifies the type. in parseFunctionBody()
5976 unsigned TyID = Record[0]; in parseFunctionBody()
5979 return error("Invalid phi record"); in parseFunctionBody()
5982 // There is an optional final record for fast-math-flags if this phi has a in parseFunctionBody()
5984 size_t NumArgs = (Record.size() - 1) / 2; in parseFunctionBody()
5986 if ((Record.size() - 1) % 2 == 1 && !isa<FPMathOperator>(PN)) { in parseFunctionBody()
5988 return error("Invalid phi record"); in parseFunctionBody()
5994 BasicBlock *BB = getBasicBlock(Record[i * 2 + 2]); in parseFunctionBody()
6026 V = getValueSigned(Record, i * 2 + 1, NextValueNo, Ty, TyID, EdgeBB); in parseFunctionBody()
6028 V = getValue(Record, i * 2 + 1, NextValueNo, Ty, TyID, EdgeBB); in parseFunctionBody()
6032 return error("Invalid phi record"); in parseFunctionBody()
6045 // If there are an even number of records, the final record must be FMF. in parseFunctionBody()
6046 if (Record.size() % 2 == 0) { in parseFunctionBody()
6048 FastMathFlags FMF = getDecodedFastMathFlags(Record[Record.size() - 1]); in parseFunctionBody()
6061 if (Record.size() < 3) in parseFunctionBody()
6062 return error("Invalid record"); in parseFunctionBody()
6065 if (Record.size() < 4) in parseFunctionBody()
6066 return error("Invalid record"); in parseFunctionBody()
6068 ResTypeID = Record[Idx++]; in parseFunctionBody()
6071 return error("Invalid record"); in parseFunctionBody()
6075 if (getValueTypePair(Record, Idx, NextValueNo, PersFn, PersFnTypeID, in parseFunctionBody()
6077 return error("Invalid record"); in parseFunctionBody()
6085 bool IsCleanup = !!Record[Idx++]; in parseFunctionBody()
6086 unsigned NumClauses = Record[Idx++]; in parseFunctionBody()
6091 LandingPadInst::ClauseType(Record[Idx++]); (void)CT; in parseFunctionBody()
6095 if (getValueTypePair(Record, Idx, NextValueNo, Val, ValTypeID, in parseFunctionBody()
6098 return error("Invalid record"); in parseFunctionBody()
6116 if (Record.size() != 4 && Record.size() != 5) in parseFunctionBody()
6117 return error("Invalid record"); in parseFunctionBody()
6119 const uint64_t Rec = Record[3]; in parseFunctionBody()
6122 unsigned TyID = Record[0]; in parseFunctionBody()
6130 unsigned OpTyID = Record[1]; in parseFunctionBody()
6132 Value *Size = getFnValueByID(Record[2], OpTy, OpTyID, CurBB); in parseFunctionBody()
6141 return error("Invalid record"); in parseFunctionBody()
6144 unsigned AS = Record.size() == 5 ? Record[4] : DL.getAllocaAddrSpace(); in parseFunctionBody()
6167 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB) || in parseFunctionBody()
6168 (OpNum + 2 != Record.size() && OpNum + 3 != Record.size())) in parseFunctionBody()
6169 return error("Invalid record"); in parseFunctionBody()
6175 if (OpNum + 3 == Record.size()) { in parseFunctionBody()
6176 ResTypeID = Record[OpNum++]; in parseFunctionBody()
6190 if (Error Err = parseAlignmentValue(Record[OpNum], Align)) in parseFunctionBody()
6197 I = new LoadInst(Ty, Op, "", Record[OpNum + 1], *Align); in parseFunctionBody()
6206 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB) || in parseFunctionBody()
6207 (OpNum + 4 != Record.size() && OpNum + 5 != Record.size())) in parseFunctionBody()
6208 return error("Invalid record"); in parseFunctionBody()
6214 if (OpNum + 5 == Record.size()) { in parseFunctionBody()
6215 ResTypeID = Record[OpNum++]; in parseFunctionBody()
6228 AtomicOrdering Ordering = getDecodedOrdering(Record[OpNum + 2]); in parseFunctionBody()
6232 return error("Invalid record"); in parseFunctionBody()
6233 if (Ordering != AtomicOrdering::NotAtomic && Record[OpNum] == 0) in parseFunctionBody()
6234 return error("Invalid record"); in parseFunctionBody()
6235 SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 3]); in parseFunctionBody()
6238 if (Error Err = parseAlignmentValue(Record[OpNum], Align)) in parseFunctionBody()
6242 I = new LoadInst(Ty, Op, "", Record[OpNum + 1], *Align, Ordering, SSID); in parseFunctionBody()
6251 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, PtrTypeID, CurBB)) in parseFunctionBody()
6252 return error("Invalid record"); in parseFunctionBody()
6255 if (getValueTypePair(Record, OpNum, NextValueNo, Val, ValTypeID, CurBB)) in parseFunctionBody()
6256 return error("Invalid record"); in parseFunctionBody()
6259 if (popValue(Record, OpNum, NextValueNo, getTypeByID(ValTypeID), in parseFunctionBody()
6261 return error("Invalid record"); in parseFunctionBody()
6264 if (OpNum + 2 != Record.size()) in parseFunctionBody()
6265 return error("Invalid record"); in parseFunctionBody()
6270 if (Error Err = parseAlignmentValue(Record[OpNum], Align)) in parseFunctionBody()
6277 I = new StoreInst(Val, Ptr, Record[OpNum + 1], *Align); in parseFunctionBody()
6287 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, PtrTypeID, CurBB) || in parseFunctionBody()
6289 return error("Invalid record"); in parseFunctionBody()
6291 if (getValueTypePair(Record, OpNum, NextValueNo, Val, ValTypeID, CurBB)) in parseFunctionBody()
6292 return error("Invalid record"); in parseFunctionBody()
6295 if (popValue(Record, OpNum, NextValueNo, getTypeByID(ValTypeID), in parseFunctionBody()
6297 return error("Invalid record"); in parseFunctionBody()
6300 if (OpNum + 4 != Record.size()) in parseFunctionBody()
6301 return error("Invalid record"); in parseFunctionBody()
6305 AtomicOrdering Ordering = getDecodedOrdering(Record[OpNum + 2]); in parseFunctionBody()
6309 return error("Invalid record"); in parseFunctionBody()
6310 SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 3]); in parseFunctionBody()
6311 if (Ordering != AtomicOrdering::NotAtomic && Record[OpNum] == 0) in parseFunctionBody()
6312 return error("Invalid record"); in parseFunctionBody()
6315 if (Error Err = parseAlignmentValue(Record[OpNum], Align)) in parseFunctionBody()
6319 I = new StoreInst(Val, Ptr, Record[OpNum + 1], *Align, Ordering, SSID); in parseFunctionBody()
6326 const size_t NumRecords = Record.size(); in parseFunctionBody()
6330 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, PtrTypeID, CurBB)) in parseFunctionBody()
6331 return error("Invalid record"); in parseFunctionBody()
6338 if (popValue(Record, OpNum, NextValueNo, getTypeByID(CmpTypeID), in parseFunctionBody()
6340 return error("Invalid record"); in parseFunctionBody()
6343 if (popValue(Record, OpNum, NextValueNo, Cmp->getType(), CmpTypeID, in parseFunctionBody()
6346 return error("Invalid record"); in parseFunctionBody()
6349 getDecodedOrdering(Record[OpNum + 1]); in parseFunctionBody()
6352 return error("Invalid record"); in parseFunctionBody()
6354 const SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 2]); in parseFunctionBody()
6362 : getDecodedOrdering(Record[OpNum + 3]); in parseFunctionBody()
6366 return error("Invalid record"); in parseFunctionBody()
6373 cast<AtomicCmpXchgInst>(I)->setVolatile(Record[OpNum]); in parseFunctionBody()
6383 cast<AtomicCmpXchgInst>(I)->setWeak(Record[OpNum + 4]); in parseFunctionBody()
6394 const size_t NumRecords = Record.size(); in parseFunctionBody()
6398 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, PtrTypeID, CurBB)) in parseFunctionBody()
6399 return error("Invalid record"); in parseFunctionBody()
6406 if (getValueTypePair(Record, OpNum, NextValueNo, Cmp, CmpTypeID, CurBB)) in parseFunctionBody()
6407 return error("Invalid record"); in parseFunctionBody()
6410 if (popValue(Record, OpNum, NextValueNo, Cmp->getType(), CmpTypeID, Val, in parseFunctionBody()
6412 return error("Invalid record"); in parseFunctionBody()
6415 return error("Invalid record"); in parseFunctionBody()
6417 const bool IsVol = Record[OpNum]; in parseFunctionBody()
6420 getDecodedOrdering(Record[OpNum + 1]); in parseFunctionBody()
6424 const SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 2]); in parseFunctionBody()
6430 getDecodedOrdering(Record[OpNum + 3]); in parseFunctionBody()
6434 const bool IsWeak = Record[OpNum + 4]; in parseFunctionBody()
6439 if (Error Err = parseAlignmentValue(Record[OpNum + 5], Alignment)) in parseFunctionBody()
6461 const size_t NumRecords = Record.size(); in parseFunctionBody()
6466 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, PtrTypeID, CurBB)) in parseFunctionBody()
6467 return error("Invalid record"); in parseFunctionBody()
6470 return error("Invalid record"); in parseFunctionBody()
6476 if (popValue(Record, OpNum, NextValueNo, in parseFunctionBody()
6478 return error("Invalid record"); in parseFunctionBody()
6480 if (getValueTypePair(Record, OpNum, NextValueNo, Val, ValTypeID, CurBB)) in parseFunctionBody()
6481 return error("Invalid record"); in parseFunctionBody()
6485 return error("Invalid record"); in parseFunctionBody()
6488 getDecodedRMWOperation(Record[OpNum]); in parseFunctionBody()
6491 return error("Invalid record"); in parseFunctionBody()
6493 const bool IsVol = Record[OpNum + 1]; in parseFunctionBody()
6495 const AtomicOrdering Ordering = getDecodedOrdering(Record[OpNum + 2]); in parseFunctionBody()
6498 return error("Invalid record"); in parseFunctionBody()
6500 const SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 3]); in parseFunctionBody()
6505 if (Error Err = parseAlignmentValue(Record[OpNum + 4], Alignment)) in parseFunctionBody()
6521 if (2 != Record.size()) in parseFunctionBody()
6522 return error("Invalid record"); in parseFunctionBody()
6523 AtomicOrdering Ordering = getDecodedOrdering(Record[0]); in parseFunctionBody()
6527 return error("Invalid record"); in parseFunctionBody()
6528 SyncScope::ID SSID = getDecodedSyncScopeID(Record[1]); in parseFunctionBody()
6539 return error("Invalid dbg record: missing instruction"); in parseFunctionBody()
6540 DILocation *DIL = cast<DILocation>(getFnMetadataByID(Record[0])); in parseFunctionBody()
6541 DILabel *Label = cast<DILabel>(getFnMetadataByID(Record[1])); in parseFunctionBody()
6555 return error("Invalid dbg record: missing instruction"); in parseFunctionBody()
6569 DILocation *DIL = cast<DILocation>(getFnMetadataByID(Record[Slot++])); in parseFunctionBody()
6571 cast<DILocalVariable>(getFnMetadataByID(Record[Slot++])); in parseFunctionBody()
6573 cast<DIExpression>(getFnMetadataByID(Record[Slot++])); in parseFunctionBody()
6581 // use-before-defs are encoded with the standard non-abbrev record in parseFunctionBody()
6586 if (getValueTypePair(Record, Slot, NextValueNo, V, TyID, CurBB)) in parseFunctionBody()
6587 return error("Invalid dbg record: invalid value"); in parseFunctionBody()
6592 RawLocation = getFnMetadataByID(Record[Slot++]); in parseFunctionBody()
6607 DIAssignID *ID = cast<DIAssignID>(getFnMetadataByID(Record[Slot++])); in parseFunctionBody()
6609 cast<DIExpression>(getFnMetadataByID(Record[Slot++])); in parseFunctionBody()
6610 Metadata *Addr = getFnMetadataByID(Record[Slot++]); in parseFunctionBody()
6623 if (Record.size() < 3) in parseFunctionBody()
6624 return error("Invalid record"); in parseFunctionBody()
6627 AttributeList PAL = getAttributes(Record[OpNum++]); in parseFunctionBody()
6628 unsigned CCInfo = Record[OpNum++]; in parseFunctionBody()
6632 FMF = getDecodedFastMathFlags(Record[OpNum++]); in parseFunctionBody()
6640 FTyID = Record[OpNum++]; in parseFunctionBody()
6648 if (getValueTypePair(Record, OpNum, NextValueNo, Callee, CalleeTypeID, in parseFunctionBody()
6650 return error("Invalid record"); in parseFunctionBody()
6661 if (Record.size() < FTy->getNumParams() + OpNum) in parseFunctionBody()
6670 Args.push_back(getBasicBlock(Record[OpNum])); in parseFunctionBody()
6672 Args.push_back(getValue(Record, OpNum, NextValueNo, in parseFunctionBody()
6676 return error("Invalid record"); in parseFunctionBody()
6681 if (OpNum != Record.size()) in parseFunctionBody()
6682 return error("Invalid record"); in parseFunctionBody()
6684 while (OpNum != Record.size()) { in parseFunctionBody()
6687 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
6688 return error("Invalid record"); in parseFunctionBody()
6728 if (Record.size() < 3) in parseFunctionBody()
6729 return error("Invalid record"); in parseFunctionBody()
6730 unsigned OpTyID = Record[0]; in parseFunctionBody()
6732 Value *Op = getValue(Record, 1, NextValueNo, OpTy, OpTyID, CurBB); in parseFunctionBody()
6733 ResTypeID = Record[2]; in parseFunctionBody()
6736 return error("Invalid record"); in parseFunctionBody()
6747 if (Record.empty() || Record[0] >= BundleTags.size()) in parseFunctionBody()
6748 return error("Invalid record"); in parseFunctionBody()
6753 while (OpNum != Record.size()) { in parseFunctionBody()
6756 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
6757 return error("Invalid record"); in parseFunctionBody()
6761 OperandBundles.emplace_back(BundleTags[Record[0]], std::move(Inputs)); in parseFunctionBody()
6769 if (getValueTypePair(Record, OpNum, NextValueNo, Op, OpTypeID, CurBB)) in parseFunctionBody()
6770 return error("Invalid record"); in parseFunctionBody()
6771 if (OpNum != Record.size()) in parseFunctionBody()
6772 return error("Invalid record"); in parseFunctionBody()
7144 SmallVector<uint64_t, 64> Record; in parseValueSymbolTable() local
7164 case BitstreamEntry::Record: in parseValueSymbolTable()
7169 // Read a record. in parseValueSymbolTable()
7170 Record.clear(); in parseValueSymbolTable()
7171 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseValueSymbolTable()
7178 if (convertToString(Record, 1, ValueName)) in parseValueSymbolTable()
7179 return error("Invalid record"); in parseValueSymbolTable()
7180 unsigned ValueID = Record[0]; in parseValueSymbolTable()
7192 if (convertToString(Record, 2, ValueName)) in parseValueSymbolTable()
7193 return error("Invalid record"); in parseValueSymbolTable()
7194 unsigned ValueID = Record[0]; in parseValueSymbolTable()
7206 unsigned ValueID = Record[0]; in parseValueSymbolTable()
7207 GlobalValue::GUID RefGUID = Record[1]; in parseValueSymbolTable()
7225 SmallVector<uint64_t, 64> Record; in parseModule() local
7258 "Expected early VST parse via VSTOffset record"); in parseModule()
7289 case BitstreamEntry::Record: { in parseModule()
7290 Record.clear(); in parseModule()
7291 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in parseModule()
7298 if (Error Err = parseVersionRecord(Record).takeError()) in parseModule()
7305 if (convertToString(Record, 0, ValueName)) in parseModule()
7306 return error("Invalid record"); in parseModule()
7312 if (Record.size() != 5) in parseModule()
7313 return error("Invalid hash length " + Twine(Record.size()).str()); in parseModule()
7316 for (auto &Val : Record) { in parseModule()
7324 if (Record.empty()) in parseModule()
7325 return error("Invalid record"); in parseModule()
7329 VSTOffset = Record[0] - 1; in parseModule()
7340 std::tie(Name, GVRecord) = readNameFromStrtab(Record); in parseModule()
7342 return error("Invalid record"); in parseModule()
7361 ModuleSummaryIndexBitcodeReader::makeRefList(ArrayRef<uint64_t> Record) { in makeRefList() argument
7363 Ret.reserve(Record.size()); in makeRefList()
7364 for (uint64_t RefValueId : Record) in makeRefList()
7370 ModuleSummaryIndexBitcodeReader::makeCallList(ArrayRef<uint64_t> Record, in makeCallList() argument
7374 // In the case of new profile formats, there are two Record entries per in makeCallList()
7375 // Edge. Otherwise, conservatively reserve up to Record.size. in makeCallList()
7377 Ret.reserve(Record.size() / 2); in makeCallList()
7379 Ret.reserve(Record.size()); in makeCallList()
7381 for (unsigned I = 0, E = Record.size(); I != E; ++I) { in makeCallList()
7385 ValueInfo Callee = std::get<0>(getValueInfoFromValueId(Record[I])); in makeCallList()
7392 getDecodedHotnessCallEdgeInfo(Record[++I]); in makeCallList()
7394 getDecodedRelBFCallEdgeInfo(Record[++I], RelBF, HasTailCall); in makeCallList()
7402 parseWholeProgramDevirtResolutionByArg(ArrayRef<uint64_t> Record, size_t &Slot, in parseWholeProgramDevirtResolutionByArg() argument
7404 uint64_t ArgNum = Record[Slot++]; in parseWholeProgramDevirtResolutionByArg()
7406 Wpd.ResByArg[{Record.begin() + Slot, Record.begin() + Slot + ArgNum}]; in parseWholeProgramDevirtResolutionByArg()
7410 static_cast<WholeProgramDevirtResolution::ByArg::Kind>(Record[Slot++]); in parseWholeProgramDevirtResolutionByArg()
7411 B.Info = Record[Slot++]; in parseWholeProgramDevirtResolutionByArg()
7412 B.Byte = Record[Slot++]; in parseWholeProgramDevirtResolutionByArg()
7413 B.Bit = Record[Slot++]; in parseWholeProgramDevirtResolutionByArg()
7416 static void parseWholeProgramDevirtResolution(ArrayRef<uint64_t> Record, in parseWholeProgramDevirtResolution() argument
7419 uint64_t Id = Record[Slot++]; in parseWholeProgramDevirtResolution()
7422 Wpd.TheKind = static_cast<WholeProgramDevirtResolution::Kind>(Record[Slot++]); in parseWholeProgramDevirtResolution()
7423 Wpd.SingleImplName = {Strtab.data() + Record[Slot], in parseWholeProgramDevirtResolution()
7424 static_cast<size_t>(Record[Slot + 1])}; in parseWholeProgramDevirtResolution()
7427 uint64_t ResByArgNum = Record[Slot++]; in parseWholeProgramDevirtResolution()
7429 parseWholeProgramDevirtResolutionByArg(Record, Slot, Wpd); in parseWholeProgramDevirtResolution()
7432 static void parseTypeIdSummaryRecord(ArrayRef<uint64_t> Record, in parseTypeIdSummaryRecord() argument
7437 {Strtab.data() + Record[Slot], static_cast<size_t>(Record[Slot + 1])}); in parseTypeIdSummaryRecord()
7440 TypeId.TTRes.TheKind = static_cast<TypeTestResolution::Kind>(Record[Slot++]); in parseTypeIdSummaryRecord()
7441 TypeId.TTRes.SizeM1BitWidth = Record[Slot++]; in parseTypeIdSummaryRecord()
7442 TypeId.TTRes.AlignLog2 = Record[Slot++]; in parseTypeIdSummaryRecord()
7443 TypeId.TTRes.SizeM1 = Record[Slot++]; in parseTypeIdSummaryRecord()
7444 TypeId.TTRes.BitMask = Record[Slot++]; in parseTypeIdSummaryRecord()
7445 TypeId.TTRes.InlineBits = Record[Slot++]; in parseTypeIdSummaryRecord()
7447 while (Slot < Record.size()) in parseTypeIdSummaryRecord()
7448 parseWholeProgramDevirtResolution(Record, Strtab, Slot, TypeId); in parseTypeIdSummaryRecord()
7452 ModuleSummaryIndexBitcodeReader::parseParamAccesses(ArrayRef<uint64_t> Record) { in parseParamAccesses() argument
7455 BitcodeReader::decodeSignRotatedValue(Record.front())); in parseParamAccesses()
7456 Record = Record.drop_front(); in parseParamAccesses()
7458 BitcodeReader::decodeSignRotatedValue(Record.front())); in parseParamAccesses()
7459 Record = Record.drop_front(); in parseParamAccesses()
7467 while (!Record.empty()) { in parseParamAccesses()
7470 ParamAccess.ParamNo = Record.front(); in parseParamAccesses()
7471 Record = Record.drop_front(); in parseParamAccesses()
7473 ParamAccess.Calls.resize(Record.front()); in parseParamAccesses()
7474 Record = Record.drop_front(); in parseParamAccesses()
7476 Call.ParamNo = Record.front(); in parseParamAccesses()
7477 Record = Record.drop_front(); in parseParamAccesses()
7478 Call.Callee = std::get<0>(getValueInfoFromValueId(Record.front())); in parseParamAccesses()
7479 Record = Record.drop_front(); in parseParamAccesses()
7487 ArrayRef<uint64_t> Record, size_t &Slot, in parseTypeIdCompatibleVtableInfo() argument
7489 uint64_t Offset = Record[Slot++]; in parseTypeIdCompatibleVtableInfo()
7490 ValueInfo Callee = std::get<0>(getValueInfoFromValueId(Record[Slot++])); in parseTypeIdCompatibleVtableInfo()
7495 ArrayRef<uint64_t> Record) { in parseTypeIdCompatibleVtableSummaryRecord() argument
7499 {Strtab.data() + Record[Slot], in parseTypeIdCompatibleVtableSummaryRecord()
7500 static_cast<size_t>(Record[Slot + 1])}); in parseTypeIdCompatibleVtableSummaryRecord()
7503 while (Slot < Record.size()) in parseTypeIdCompatibleVtableSummaryRecord()
7504 parseTypeIdCompatibleVtableInfo(Record, Slot, TypeId); in parseTypeIdCompatibleVtableSummaryRecord()
7524 SmallVector<uint64_t, 64> Record; in parseEntireSummary() local
7533 if (Entry.Kind != BitstreamEntry::Record) in parseEntireSummary()
7534 return error("Invalid Summary Block: record for version expected"); in parseEntireSummary()
7535 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseEntireSummary()
7541 const uint64_t Version = Record[0]; in parseEntireSummary()
7548 Record.clear(); in parseEntireSummary()
7580 case BitstreamEntry::Record: in parseEntireSummary()
7585 // Read a record. The record format depends on whether this in parseEntireSummary()
7592 Record.clear(); in parseEntireSummary()
7593 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in parseEntireSummary()
7600 TheIndex.setFlags(Record[0]); in parseEntireSummary()
7604 uint64_t ValueID = Record[0]; in parseEntireSummary()
7605 GlobalValue::GUID RefGUID = Record[1]; in parseEntireSummary()
7622 unsigned ValueID = Record[0]; in parseEntireSummary()
7623 uint64_t RawFlags = Record[1]; in parseEntireSummary()
7624 unsigned InstCount = Record[2]; in parseEntireSummary()
7626 unsigned NumRefs = Record[3]; in parseEntireSummary()
7630 RawFunFlags = Record[3]; in parseEntireSummary()
7631 NumRefs = Record[4]; in parseEntireSummary()
7634 NumRORefs = Record[5]; in parseEntireSummary()
7637 NumWORefs = Record[6]; in parseEntireSummary()
7650 assert(Record.size() >= RefListStartIndex + NumRefs && in parseEntireSummary()
7651 "Record size inconsistent with number of references"); in parseEntireSummary()
7653 ArrayRef<uint64_t>(Record).slice(RefListStartIndex, NumRefs)); in parseEntireSummary()
7657 ArrayRef<uint64_t>(Record).slice(CallGraphEdgeStartIndex), in parseEntireSummary()
7661 // In order to save memory, only record the memprof summaries if this is in parseEntireSummary()
7690 unsigned ValueID = Record[0]; in parseEntireSummary()
7691 uint64_t RawFlags = Record[1]; in parseEntireSummary()
7692 unsigned AliaseeID = Record[2]; in parseEntireSummary()
7715 unsigned ValueID = Record[0]; in parseEntireSummary()
7716 uint64_t RawFlags = Record[1]; in parseEntireSummary()
7724 GVF = getDecodedGVarFlags(Record[2]); in parseEntireSummary()
7728 makeRefList(ArrayRef<uint64_t>(Record).slice(RefArrayStart)); in parseEntireSummary()
7741 unsigned ValueID = Record[0]; in parseEntireSummary()
7742 uint64_t RawFlags = Record[1]; in parseEntireSummary()
7743 GlobalVarSummary::GVarFlags GVF = getDecodedGVarFlags(Record[2]); in parseEntireSummary()
7744 unsigned NumRefs = Record[3]; in parseEntireSummary()
7749 ArrayRef<uint64_t>(Record).slice(RefListStartIndex, NumRefs)); in parseEntireSummary()
7751 for (unsigned I = VTableListStartIndex, E = Record.size(); I != E; ++I) { in parseEntireSummary()
7752 ValueInfo Callee = std::get<0>(getValueInfoFromValueId(Record[I])); in parseEntireSummary()
7753 uint64_t Offset = Record[++I]; in parseEntireSummary()
7773 unsigned ValueID = Record[0]; in parseEntireSummary()
7774 uint64_t ModuleId = Record[1]; in parseEntireSummary()
7775 uint64_t RawFlags = Record[2]; in parseEntireSummary()
7776 unsigned InstCount = Record[3]; in parseEntireSummary()
7779 unsigned NumRefs = Record[4]; in parseEntireSummary()
7784 RawFunFlags = Record[4]; in parseEntireSummary()
7792 EntryCount = Record[5]; in parseEntireSummary()
7796 NumWORefs = Record[8]; in parseEntireSummary()
7800 NumRORefs = Record[RefListStartIndex - NumRORefsOffset]; in parseEntireSummary()
7802 NumRefs = Record[NumRefsIndex]; in parseEntireSummary()
7807 assert(Record.size() >= RefListStartIndex + NumRefs && in parseEntireSummary()
7808 "Record size inconsistent with number of references"); in parseEntireSummary()
7810 ArrayRef<uint64_t>(Record).slice(RefListStartIndex, NumRefs)); in parseEntireSummary()
7813 ArrayRef<uint64_t>(Record).slice(CallGraphEdgeStartIndex), in parseEntireSummary()
7836 unsigned ValueID = Record[0]; in parseEntireSummary()
7837 uint64_t ModuleId = Record[1]; in parseEntireSummary()
7838 uint64_t RawFlags = Record[2]; in parseEntireSummary()
7839 unsigned AliaseeValueId = Record[3]; in parseEntireSummary()
7856 unsigned ValueID = Record[0]; in parseEntireSummary()
7857 uint64_t ModuleId = Record[1]; in parseEntireSummary()
7858 uint64_t RawFlags = Record[2]; in parseEntireSummary()
7866 GVF = getDecodedGVarFlags(Record[3]); in parseEntireSummary()
7870 makeRefList(ArrayRef<uint64_t>(Record).slice(RefArrayStart)); in parseEntireSummary()
7882 uint64_t OriginalName = Record[0]; in parseEntireSummary()
7884 return error("Name attachment that does not follow a combined record"); in parseEntireSummary()
7894 llvm::append_range(PendingTypeTests, Record); in parseEntireSummary()
7899 for (unsigned I = 0; I != Record.size(); I += 2) in parseEntireSummary()
7900 PendingTypeTestAssumeVCalls.push_back({Record[I], Record[I+1]}); in parseEntireSummary()
7905 for (unsigned I = 0; I != Record.size(); I += 2) in parseEntireSummary()
7906 PendingTypeCheckedLoadVCalls.push_back({Record[I], Record[I+1]}); in parseEntireSummary()
7911 {{Record[0], Record[1]}, {Record.begin() + 2, Record.end()}}); in parseEntireSummary()
7916 {{Record[0], Record[1]}, {Record.begin() + 2, Record.end()}}); in parseEntireSummary()
7921 for (unsigned I = 0; I != Record.size(); I += 2) in parseEntireSummary()
7923 {Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])}); in parseEntireSummary()
7929 for (unsigned I = 0; I != Record.size(); I += 2) in parseEntireSummary()
7931 {Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])}); in parseEntireSummary()
7936 parseTypeIdSummaryRecord(Record, Strtab, TheIndex); in parseEntireSummary()
7940 parseTypeIdCompatibleVtableSummaryRecord(Record); in parseEntireSummary()
7944 TheIndex.addBlockCount(Record[0]); in parseEntireSummary()
7948 PendingParamAccesses = parseParamAccesses(Record); in parseEntireSummary()
7955 StackIds = ArrayRef<uint64_t>(Record); in parseEntireSummary()
7960 unsigned ValueID = Record[0]; in parseEntireSummary()
7962 for (auto R = Record.begin() + 1; R != Record.end(); R++) { in parseEntireSummary()
7972 auto RecordIter = Record.begin(); in parseEntireSummary()
7976 assert(Record.size() == 3 + NumStackIds + NumVersions); in parseEntireSummary()
7998 NumMIBs = Record[I++]; in parseEntireSummary()
8001 (Version < 10 && I < Record.size())) { in parseEntireSummary()
8002 assert(Record.size() - I >= 2); in parseEntireSummary()
8003 AllocationType AllocType = (AllocationType)Record[I++]; in parseEntireSummary()
8004 unsigned NumStackEntries = Record[I++]; in parseEntireSummary()
8005 assert(Record.size() - I >= NumStackEntries); in parseEntireSummary()
8008 assert(Record[I] < StackIds.size()); in parseEntireSummary()
8010 TheIndex.addOrGetStackIdIndex(StackIds[Record[I++]])); in parseEntireSummary()
8016 assert(I == Record.size() || Record.size() - I == NumMIBs); in parseEntireSummary()
8017 if (I < Record.size()) { in parseEntireSummary()
8020 TotalSizes.push_back(Record[I++]); in parseEntireSummary()
8033 unsigned NumMIBs = Record[I++]; in parseEntireSummary()
8034 unsigned NumVersions = Record[I++]; in parseEntireSummary()
8037 assert(Record.size() - I >= 2); in parseEntireSummary()
8038 AllocationType AllocType = (AllocationType)Record[I++]; in parseEntireSummary()
8039 unsigned NumStackEntries = Record[I++]; in parseEntireSummary()
8040 assert(Record.size() - I >= NumStackEntries); in parseEntireSummary()
8043 assert(Record[I] < StackIds.size()); in parseEntireSummary()
8045 TheIndex.addOrGetStackIdIndex(StackIds[Record[I++]])); in parseEntireSummary()
8049 assert(Record.size() - I >= NumVersions); in parseEntireSummary()
8052 Versions.push_back(Record[I++]); in parseEntireSummary()
8055 assert(I == Record.size() || Record.size() - I == NumMIBs); in parseEntireSummary()
8056 if (I < Record.size()) { in parseEntireSummary()
8059 TotalSizes.push_back(Record[I++]); in parseEntireSummary()
8081 SmallVector<uint64_t, 64> Record; in parseModuleStringTable() local
8098 case BitstreamEntry::Record: in parseModuleStringTable()
8103 Record.clear(); in parseModuleStringTable()
8104 Expected<unsigned> MaybeRecord = Stream.readRecord(Entry.ID, Record); in parseModuleStringTable()
8112 uint64_t ModuleId = Record[0]; in parseModuleStringTable()
8114 if (convertToString(Record, 1, ModulePath)) in parseModuleStringTable()
8115 return error("Invalid record"); in parseModuleStringTable()
8125 if (Record.size() != 5) in parseModuleStringTable()
8126 return error("Invalid hash length " + Twine(Record.size()).str()); in parseModuleStringTable()
8130 for (auto &Val : Record) { in parseModuleStringTable()
8194 case BitstreamEntry::Record: in readBlobInRecord()
8196 SmallVector<uint64_t, 1> Record; in readBlobInRecord() local
8198 Stream.readRecord(Entry.ID, Record, &Blob); in readBlobInRecord()
8321 case BitstreamEntry::Record: in getBitcodeFileContents()
8424 SmallVector<uint64_t, 64> Record; in getEnableSplitLTOUnitAndUnifiedFlag() local
8437 // If no flags record found, set both flags to false. in getEnableSplitLTOUnitAndUnifiedFlag()
8440 case BitstreamEntry::Record: in getEnableSplitLTOUnitAndUnifiedFlag()
8445 // Look for the FS_FLAGS record. in getEnableSplitLTOUnitAndUnifiedFlag()
8446 Record.clear(); in getEnableSplitLTOUnitAndUnifiedFlag()
8447 Expected<unsigned> MaybeBitCode = Stream.readRecord(Entry.ID, Record); in getEnableSplitLTOUnitAndUnifiedFlag()
8454 uint64_t Flags = Record[0]; in getEnableSplitLTOUnitAndUnifiedFlag()
8520 case BitstreamEntry::Record: in getLTOInfo()