Home | History | Annotate | Download | only in Reader

Lines Matching full:record

61 /// ConvertToString - Convert a string from a record into an std::string, return
64 static bool ConvertToString(ArrayRef<uint64_t> Record, unsigned Idx,
66 if (Idx > Record.size())
69 for (unsigned i = Idx, e = Record.size(); i != e; ++i)
70 Result += (char)Record[i];
495 SmallVector<uint64_t, 64> Record;
509 case BitstreamEntry::Record:
514 // Read a record.
515 Record.clear();
516 switch (Stream.readRecord(Entry.ID, Record)) {
521 if (Record.size() & 1)
524 for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
526 decodeLLVMAttributesForBitcode(B, Record[i+1]);
527 Attrs.push_back(AttributeSet::get(Context, Record[i], B));
535 for (unsigned i = 0, e = Record.size(); i != e; ++i)
536 Attrs.push_back(MAttributeGroups[Record[i]]);
649 SmallVector<uint64_t, 64> Record;
661 case BitstreamEntry::Record:
666 // Read a record.
667 Record.clear();
668 switch (Stream.readRecord(Entry.ID, Record)) {
672 if (Record.size() < 3)
675 uint64_t GrpID = Record[0];
676 uint64_t Idx = Record[1]; // Index of the object this attribute refers to.
679 for (unsigned i = 2, e = Record.size(); i != e; ++i) {
680 if (Record[i] == 0) { // Enum attribute
682 if (std::error_code EC = ParseAttrKind(Record[++i], &Kind))
686 } else if (Record[i] == 1) { // Align attribute
688 if (std::error_code EC = ParseAttrKind(Record[++i], &Kind))
691 B.addAlignmentAttr(Record[++i]);
693 B.addStackAlignmentAttr(Record[++i]);
695 assert((Record[i] == 3 || Record[i] == 4) &&
697 bool HasValue = (Record[i++] == 4);
701 while (Record[i] != 0 && i != e)
702 KindStr += Record[i++];
703 assert(Record[i] == 0 && "Kind string not null terminated");
708 while (Record[i] != 0 && i != e)
709 ValStr += Record[i++];
710 assert(Record[i] == 0 && "Value string not null terminated");
735 SmallVector<uint64_t, 64> Record;
752 case BitstreamEntry::Record:
757 // Read a record.
758 Record.clear();
760 switch (Stream.readRecord(Entry.ID, Record)) {
766 if (Record.size() < 1)
768 TypeList.resize(Record[0]);
801 if (Record.size() < 1)
804 ResultTy = IntegerType::get(Context, Record[0]);
808 if (Record.size() < 1)
811 if (Record.size() == 2)
812 AddressSpace = Record[1];
813 ResultTy = getTypeByID(Record[0]);
822 if (Record.size() < 3)
825 for (unsigned i = 3, e = Record.size(); i != e; ++i) {
826 if (Type *T = getTypeByID(Record[i]))
832 ResultTy = getTypeByID(Record[2]);
833 if (!ResultTy || ArgTys.size() < Record.size()-3)
836 ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]);
841 if (Record.size() < 2)
844 for (unsigned i = 2, e = Record.size(); i != e; ++i) {
845 if (Type *T = getTypeByID(Record[i]))
851 ResultTy = getTypeByID(Record[1]);
852 if (!ResultTy || ArgTys.size() < Record.size()-2)
855 ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]);
859 if (Record.size() < 1)
862 for (unsigned i = 1, e = Record.size(); i != e; ++i) {
863 if (Type *T = getTypeByID(Record[i]))
868 if (EltTys.size() != Record.size()-1)
870 ResultTy = StructType::get(Context, EltTys, Record[0]);
874 if (ConvertToString(Record, 0, TypeName))
879 if (Record.size() < 1)
895 for (unsigned i = 1, e = Record.size(); i != e; ++i) {
896 if (Type *T = getTypeByID(Record[i]))
901 if (EltTys.size() != Record.size()-1)
903 Res->setBody(EltTys, Record[0]);
908 if (Record.size() != 1)
926 if (Record.size() < 2)
928 if ((ResultTy = getTypeByID(Record[1])))
929 ResultTy = ArrayType::get(ResultTy, Record[0]);
934 if (Record.size() < 2)
936 if ((ResultTy = getTypeByID(Record[1])))
937 ResultTy = VectorType::get(ResultTy, Record[0]);
955 SmallVector<uint64_t, 64> Record;
968 case BitstreamEntry::Record:
973 // Read a record.
974 Record.clear();
975 switch (Stream.readRecord(Entry.ID, Record)) {
979 if (ConvertToString(Record, 1, ValueName))
981 unsigned ValueID = Record
991 if (ConvertToString(Record, 1, ValueName))
993 BasicBlock *BB = getBasicBlock(Record[0]);
1011 SmallVector<uint64_t, 64> Record;
1023 case BitstreamEntry::Record:
1029 // Read a record.
1030 Record.clear();
1031 unsigned Code = Stream.readRecord(Entry.ID, Record);
1037 SmallString<8> Name(Record.begin(), Record.end());
1038 Record.clear();
1042 unsigned NextBitCode = Stream.readRecord(Code, Record);
1046 unsigned Size = Record.size();
1049 MDNode *MD = dyn_cast_or_null<MDNode>(MDValueList.getValueFwdRef(Record[i]));
1060 if (Record.size() % 2 == 1)
1063 unsigned Size = Record.size();
1066 Type *Ty = getTypeByID(Record[i]);
1070 Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
1072 Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
1082 std::string String(Record.begin(), Record.end());
1089 if (Record.size() < 2)
1092 unsigned Kind = Record[0];
1093 SmallString<8> Name(Record.begin()+1, Record.end());
1181 SmallVector<uint64_t, 64> Record;
1201 case BitstreamEntry::Record:
1206 // Read a record.
1207 Record.clear();
1209 unsigned BitCode = Stream.readRecord(Entry.ID, Record);
1216 if (Record.empty())
1218 if (Record[0] >= TypeList.size() || !TypeList[Record[0]])
1220 CurTy = TypeList[Record[0]];
1226 if (!CurTy->isIntegerTy() || Record.empty())
1228 V = ConstantInt::get(CurTy, decodeSignRotatedValue(Record[0]));
1231 if (!CurTy->isIntegerTy() || Record.empty())
1234 APInt VInt = ReadWideAPInt(Record,
1241 if (Record.empty())
1245 APInt(16, (uint16_t)Record[0])));
1248 APInt(32, (uint32_t)Record[0])));
1251 APInt(64, Record[0])));
1255 Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16);
1256 Rearrange[1] = Record[0] >> 48;
1261 APInt(128, Record)));
1264 APInt(128, Record)));
1271 if (Record.empty())
1274 unsigned Size = Record.size();
1279 Elts.push_back(ValueList.getConstantFwdRef(Record[i],
1285 Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy));
1290 Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy));
1299 if (Record.empty())
1302 SmallString<16> Elts(Record.begin(), Record.end());
1308 if (Record.empty())
1312 unsigned Size = Record.size();
1315 SmallVector<uint8_t, 16> Elts(Record.begin(), Record.end());
1321 SmallVector<uint16_t, 16> Elts(Record.begin(), Record.end());
1327 SmallVector<uint32_t, 16> Elts(Record.begin(), Record.end());
1333 SmallVector<uint64_t, 16> Elts(Record.begin(), Record.end());
1340 std::transform(Record.begin(), Record.end(), Elts.begin(), BitsToFloat);
1347 std::transform(Record.begin(), Record.end(), Elts.begin(),
1360 if (Record.size() < 3)
1362 int Opc = GetDecodedBinaryOpcode(Record[0], CurTy);
1366 Constant *LHS = ValueList.getConstantFwdRef(Record[1], CurTy);
1367 Constant *RHS = ValueList.getConstantFwdRef(Record[2], CurTy);
1369 if (Record.size() >= 4) {
1374 if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP))
1376 if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP))
1382 if (Record[3] & (1 << bitc::PEO_EXACT))
1391 if (Record.size() < 3)
1393 int Opc = GetDecodedCastOpcode(Record[0]);
1397 Type *OpTy = getTypeByID(Record[1]);
1400 Constant *Op = ValueList.getConstantFwdRef(Record[2], OpTy);
1408 if (Record.size() & 1)
1411 for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
1412 Type *ElTy = getTypeByID(Record[i]);
1415 Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy));
1424 if (Record.size() < 3)
1429 // If CurTy is a vector of length n, then Record[0] must be a <n x i1>
1435 V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0],
1437 ValueList.getConstantFwdRef(Record[1],CurTy),
1438 ValueList.getConstantFwdRef(Record[2],CurTy));
1443 if (Record.size() < 3)
1446 dyn_cast_or_null<VectorType>(getTypeByID(Record[0]));
1449 Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
1451 if (Record.size() == 4) {
1452 Type *IdxTy = getTypeByID(Record[2]);
1455 Op1 = ValueList.getConstantFwdRef(Record[3], IdxTy);
1457 Op1 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context));
1466 if (Record.size() < 3 || !OpTy)
1468 Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy);
1469 Constant *Op1 = ValueList.getConstantFwdRef(Record[1],
1472 if (Record.size() == 4) {
1473 Type *IdxTy = getTypeByID(Record[2]);
1476 Op2 = ValueList.getConstantFwdRef(Record[3], IdxTy);
1478 Op2 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context));
1486 if (Record.size() < 3 || !OpTy)
1488 Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy);
1489 Constant *Op1 = ValueList.getConstantFwdRef(Record[1], OpTy);
1492 Constant *Op2 = ValueList.getConstantFwdRef(Record[2], ShufTy);
1499 dyn_cast_or_null<VectorType>(getTypeByID(Record[0]));
1500 if (Record.size() < 4 || !RTy || !OpTy)
1502 Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
1503 Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy);
1506 Constant *Op2 = ValueList.getConstantFwdRef(Record[3], ShufTy);
1511 if (Record.size() < 4)
1513 Type *OpTy = getTypeByID(Record[0]);
1516 Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
1517 Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy);
1520 V = ConstantExpr::getFCmp(Record[3], Op0, Op1);
1522 V = ConstantExpr::getICmp(Record[3], Op0, Op1);
1528 if (Record.size() < 2)
1531 bool HasSideEffects = Record[0] & 1;
1532 bool IsAlignStack = Record[0] >> 1;
1533 unsigned AsmStrSize = Record[1];
1534 if (2+AsmStrSize >= Record.size())
1536 unsigned ConstStrSize = Record[2+AsmStrSize];
1537 if (3+AsmStrSize+ConstStrSize > Record.size())
1541 AsmStr += (char)Record[2+i];
1543 ConstrStr += (char)Record[3+AsmStrSize+i];
1552 if (Record.size() < 2)
1555 bool HasSideEffects = Record[0] & 1;
1556 bool IsAlignStack = (Record[0] >> 1) & 1;
1557 unsigned AsmDialect = Record[0] >> 2;
1558 unsigned AsmStrSize = Record[1];
1559 if (2+AsmStrSize >= Record.size())
1561 unsigned ConstStrSize = Record[2+AsmStrSize];
1562 if (3+AsmStrSize+ConstStrSize > Record.size())
1566 AsmStr += (char)Record[2+i];
1568 ConstrStr += (char)Record[3+AsmStrSize+i];
1576 if (Record.size() < 3)
1578 Type *FnTy = getTypeByID(Record[0]);
1582 dyn_cast_or_null<Function>(ValueList.getConstantFwdRef(Record[1],FnTy));
1590 for (size_t I = 0, E = Record[2]; I != E; ++I) {
1603 BlockAddrFwdRefs[Fn].push_back(std::make_pair(Record[2], FwdRef));
1619 SmallVector<uint64_t, 64> Record;
1631 case BitstreamEntry::Record:
1636 // Read a use list record.
1637 Record.clear();
1638 switch (Stream.readRecord(Entry.ID, Record)) {
1642 unsigned RecordLength = Record.size();
1645 UseListRecords.push_back(Record);
1708 SmallVector<uint64_t, 64> Record;
1789 case BitstreamEntry::Record:
1795 // Read a record.
1796 switch (Stream.readRecord(Entry.ID, Record)) {
1799 if (Record.size() < 1)
1802 unsigned module_version = Record[0];
1817 if (ConvertToString(Record, 0, S))
1824 if (ConvertToString(Record, 0, S))
1831 if (ConvertToString(Record, 0, S))
1839 if (ConvertToString(Record, 0, S))
1846 if (ConvertToString(Record, 0, S))
1853 if (ConvertToString(Record, 0, S))
1859 if (Record.size() < 2)
1861 Comdat::SelectionKind SK = getDecodedComdatSelectionKind(Record[0]);
1862 unsigned ComdatNameSize = Record[1];
1866 ComdatName += (char)Record[2 + i];
1876 if (Record.size() < 6)
1878 Type *Ty = getTypeByID(Record[0]);
1886 bool isConstant = Record[1];
1887 GlobalValue::LinkageTypes Linkage = GetDecodedLinkage(Record[3]);
1888 unsigned Alignment = (1 << Record[4]) >> 1;
1890 if (Record[5]) {
1891 if (Record[5]-1 >= SectionTable.size())
1893 Section = SectionTable[Record[5]-1];
1897 if (Record.size() > 6 && !GlobalValue::isLocalLinkage(Linkage))
1899 Visibility = GetDecodedVisibility(Record[6]);
1902 if (Record.size() > 7)
1903 TLM = GetDecodedThreadLocalMode(Record[7]);
1906 if (Record.size() > 8)
1907 UnnamedAddr = Record[8];
1910 if (Record.size() > 9)
1911 ExternallyInitialized = Record[9];
1922 if (Record.size() > 10)
1923 NewGV->setDLLStorageClass(GetDecodedDLLStorageClass(Record[10]));
1925 UpgradeDLLImportExportLinkage(NewGV, Record[3]);
1930 if (unsigned InitID = Record[2])
1933 if (Record.size() > 11)
1934 if (unsigned ComdatID = Record[11]) {
1944 if (Record.size() < 8)
1946 Type *Ty = getTypeByID(Record[0]);
1959 Func->setCallingConv(static_cast<CallingConv::ID>(Record[1]));
1960 bool isProto = Record[2];
1961 Func->setLinkage(GetDecodedLinkage(Record[3]));
1962 Func->setAttributes(getAttributes(Record[4]));
1964 Func->setAlignment((1 << Record[5]) >> 1);
1965 if (Record[6]) {
1966 if (Record[6]-1 >= SectionTable.size())
1968 Func->setSection(SectionTable[Record[6]-1]);
1973 Func->setVisibility(GetDecodedVisibility(Record[7]));
1974 if (Record.size() > 8 && Record[8]) {
1975 if (Record[8]-1 > GCTable.size())
1977 Func->setGC(GCTable[Record[8]-1].c_str());
1980 if (Record.size() > 9)
1981 UnnamedAddr = Record[9];
1983 if (Record.size() > 10 && Record[10] != 0)
1984 FunctionPrefixes.push_back(std::make_pair(Func, Record[10]-1));
1986 if (Record.size() > 11)
1987 Func->setDLLStorageClass(GetDecodedDLLStorageClass(Record[11]));
1989 UpgradeDLLImportExportLinkage(Func, Record[3]);
1991 if (Record.size() > 12)
1992 if (unsigned ComdatID = Record[12]) {
2010 if (Record.size() < 3)
2012 Type *Ty = getTypeByID(Record[0]);
2021 GetDecodedLinkage(Record[2]), "", TheModule);
2024 if (Record.size() > 3 && !NewGA->hasLocalLinkage())
2026 NewGA->setVisibility(GetDecodedVisibility(Record[3]));
2027 if (Record.size() > 4)
2028 NewGA->setDLLStorageClass(GetDecodedDLLStorageClass(Record[4]));
2030 UpgradeDLLImportExportLinkage(NewGA, Record[2]);
2031 if (Record.size() > 5)
2032 NewGA->setThreadLocalMode(GetDecodedThreadLocalMode(Record[5]));
2033 if (Record.size() > 6)
2034 NewGA->setUnnamedAddr(Record[6]);
2036 AliasInits.push_back(std::make_pair(NewGA, Record[1]));
2042 if (Record.size() < 1 || Record[0] > ValueList.size())
2044 ValueList.shrinkTo(Record[0]);
2047 Record.clear();
2103 case BitstreamEntry::Record:
2123 SmallVector<uint64_t, 64> Record;
2136 case BitstreamEntry::Record:
2141 // Read a record.
2142 switch (Stream.readRecord(Entry.ID, Record)) {
2146 if (ConvertToString(Record, 0, S))
2152 Record.clear();
2190 case BitstreamEntry::Record:
2202 SmallVector<uint64_t, 64> Record;
2212 case BitstreamEntry::Record:
2217 // Read a metadata attachment record.
2218 Record.clear();
2219 switch (Stream.readRecord(Entry.ID, Record)) {
2223 unsigned RecordLength = Record.size();
2224 if (Record.empty() || (RecordLength - 1) % 2 == 1)
2226 Instruction *Inst = InstructionList[Record[0]];
2228 unsigned Kind = Record[i];
2233 Value *Node = MDValueList.getValueFwdRef(Record[i+1]);
2264 SmallVector<uint64_t, 64> Record;
2300 case BitstreamEntry::Record:
2305 // Read a record.
2306 Record.clear();
2308 unsigned BitCode = Stream.readRecord(Entry.ID, Record);
2313 if (Record.size() < 1 || Record[0] == 0)
2316 FunctionBBs.resize(Record[0]);
2323 // This record indicates that the last instruction is at the same
2347 if (!I || Record.size() < 4)
2350 unsigned Line = Record[0], Col = Record[1];
2351 unsigned ScopeID = Record[2], IAID = Record[3];
2365 if (getValueTypePair(Record, OpNum, NextValueNo, LHS) ||
2366 popValue(Record, OpNum, NextValueNo, LHS->getType(), RHS) ||
2367 OpNum+1 > Record.size())
2370 int Opc = GetDecodedBinaryOpcode(Record[OpNum++], LHS->getType());
2375 Record.size()) {
2380 if (Record[OpNum] & (1 << bitc::OBO_NO_SIGNED_WRAP))
2382 if (Record[OpNum] & (1 << bitc::OBO_NO_UNSIGNED_WRAP))
2388 if (Record[OpNum] & (1 << bitc::PEO_EXACT))
2392 if (0 != (Record[OpNum] & FastMathFlags::UnsafeAlgebra))
2394 if (0 != (Record[OpNum] & FastMathFlags::NoNaNs))
2396 if (0 != (Record[OpNum] & FastMathFlags::NoInfs))
2398 if (0 != (Record[OpNum] & FastMathFlags::NoSignedZeros))
2400 if (0 != (Record[OpNum] & FastMathFlags::AllowReciprocal))
2412 if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
2413 OpNum+2 != Record.size())
2416 Type *ResTy = getTypeByID(Record[OpNum]);
2417 int Opc = GetDecodedCastOpcode(Record[OpNum+1]);
2436 if (getValueTypePair(Record, OpNum, NextValueNo, BasePtr))
2440 while (OpNum != Record.size()) {
2442 if (getValueTypePair(Record, OpNum, NextValueNo, Op))
2458 if (getValueTypePair(Record, OpNum, NextValueNo, Agg))
2462 for (unsigned RecSize = Record.size();
2464 uint64_t Index = Record[OpNum];
2479 if (getValueTypePair(Record, OpNum, NextValueNo, Agg))
2482 if (getValueTypePair(Record, OpNum, NextValueNo, Val))
2486 for (unsigned RecSize = Record.size();
2488 uint64_t Index = Record[OpNum];
2504 if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal) ||
2505 popValue(Record, OpNum, NextValueNo, TrueVal->getType(), FalseVal) ||
2506 popValue(Record, OpNum, NextValueNo, Type::getInt1Ty(Context), Cond))
2519 if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal) ||
2520 popValue(Record, OpNum, NextValueNo, TrueVal->getType(), FalseVal) ||
2521 getValueTypePair(Record, OpNum, NextValueNo, Cond))
2544 if (getValueTypePair(Record, OpNum, NextValueNo, Vec) ||
2545 getValueTypePair(Record, OpNum, NextValueNo, Idx))
2555 if (getValueTypePair(Record, OpNum, NextValueNo, Vec) ||
2556 popValue(Record, OpNum, NextValueNo,
2558 getValueTypePair(Record, OpNum, NextValueNo, Idx))
2568 if (getValueTypePair(Record, OpNum, NextValueNo, Vec1) ||
2569 popValue(Record, OpNum, NextValueNo, Vec1->getType(), Vec2))
2572 if (getValueTypePair(Record, OpNum, NextValueNo, Mask))
2588 if (getValueTypePair(Record, OpNum, NextValueNo, LHS) ||
2589 popValue(Record, OpNum, NextValueNo, LHS->getType(), RHS) ||
2590 OpNum+1 != Record.size())
2594 I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS);
2596 I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS);
2603 unsigned Size = Record.size();
2612 if (getValueTypePair(Record, OpNum, NextValueNo, Op))
2614 if (OpNum != Record.size())
2622 if (Record.size() != 1 && Record.size() != 3)
2624 BasicBlock *TrueDest = getBasicBlock(Record[0]);
2628 if (Record.size() == 1) {
2633 BasicBlock *FalseDest = getBasicBlock(Record[1]);
2634 Value *Cond = getValue(Record, 2, NextValueNo,
2645 if ((Record[0] >> 16) == SWITCH_INST_MAGIC) {
2651 Type *OpTy = getTypeByID(Record[1]);
2654 Value *Cond = getValue(Record, 2, NextValueNo, OpTy);
2655 BasicBlock *Default = getBasicBlock(Record[3]);
2659 unsigned NumCases = Record[4];
2667 unsigned NumItems = Record[CurIdx++];
2669 bool isSingleNumber = Record[CurIdx++];
2674 ActiveWords = Record[CurIdx++];
2675 Low = ReadWideAPInt(makeArrayRef(&Record[CurIdx], ActiveWords),
2682 ActiveWords = Record[CurIdx++];
2684 ReadWideAPInt(makeArrayRef(&Record[CurIdx], ActiveWords),
2697 BasicBlock *DestBB = getBasicBlock(Record[CurIdx++]);
2708 if (Record.size() < 3 || (Record.size() & 1) == 0)
2710 Type *OpTy = getTypeByID(Record[0]);
2711 Value *Cond = getValue(Record, 1, NextValueNo, OpTy);
2712 BasicBlock *Default = getBasicBlock(Record[2]);
2715 unsigned NumCases = (Record.size()-3)/2;
2720 dyn_cast_or_null<ConstantInt>(getFnValueByID(Record[3+i*2], OpTy));
2721 BasicBlock *DestBB = getBasicBlock(Record[1+3+i*2]);
2732 if (Record.size() < 2)
2734 Type *OpTy = getTypeByID(Record[0]);
2735 Value *Address = getValue(Record, 1, NextValueNo, OpTy);
2738 unsigned NumDests = Record.size()-2;
2742 if (BasicBlock *DestBB = getBasicBlock(Record[2+i])) {
2755 if (Record.size() < 4)
2757 AttributeSet PAL = getAttributes(Record[0]);
2758 unsigned CCInfo = Record[1];
2759 BasicBlock *NormalBB = getBasicBlock(Record[2]);
2760 BasicBlock *UnwindBB = getBasicBlock(Record[3]);
2764 if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
2773 Record.size() < OpNum+FTy->getNumParams())
2778 Ops.push_back(getValue(Record, OpNum, NextValueNo,
2785 if (Record.size() != OpNum)
2789 while (OpNum != Record.size()) {
2791 if (getValueTypePair(Record, OpNum, NextValueNo, Op))
2807 if (getValueTypePair(Record, Idx, NextValueNo, Val))
2818 if (RecordRecord.size()-1)&1))
2820 Type *Ty = getTypeByID(Record[0]);
2824 PHINode *PN = PHINode::Create(Ty, (Record.size()-1)/2);
2827 for (unsigned i = 0, e = Record.size()-1; i != e; i += 2) {
2833 V = getValueSigned(Record, 1+i, NextValueNo, Ty);
2835 V = getValue(Record, 1+i, NextValueNo, Ty);
2836 BasicBlock *BB = getBasicBlock(Record[2+i]);
2848 if (Record.size() < 4)
2850 Type *Ty = getTypeByID(Record[Idx++]);
2854 if (getValueTypePair(Record, Idx, NextValueNo, PersFn))
2857 bool IsCleanup = !!Record[Idx++];
2858 unsigned NumClauses = Record[Idx++];
2863 LandingPadInst::ClauseType(Record[Idx++]); (void)CT;
2866 if (getValueTypePair(Record, Idx, NextValueNo, Val)) {
2886 if (Record.size() != 4)
2889 dyn_cast_or_null<PointerType>(getTypeByID(Record[0]));
2890 Type *OpTy = getTypeByID(Record[1]);
2891 Value *Size = getFnValueByID(Record[2], OpTy);
2892 unsigned Align = Record[3];
2902 if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
2903 OpNum+2 != Record.size())
2906 I = new LoadInst(Op, "", Record[OpNum+1], (1 << Record[OpNum]) >> 1);
2914 if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
2915 OpNum+4 != Record.size())
2919 AtomicOrdering Ordering = GetDecodedOrdering(Record[OpNum+2]);
2923 if (Ordering != NotAtomic && Record[OpNum] == 0)
2925 SynchronizationScope SynchScope = GetDecodedSynchScope(Record[OpNum+3]);
2927 I = new LoadInst(Op, "", Record[OpNum+1], (1 << Record[OpNum]) >> 1,
2935 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
2936 popValue(Record, OpNum, NextValueNo,
2938 OpNum+2 != Record.size())
2941 I = new StoreInst(Val, Ptr, Record[OpNum+1], (1 << Record[OpNum]) >> 1);
2949 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
2950 popValue(Record, OpNum, NextValueNo,
2952 OpNum+4 != Record.size())
2955 AtomicOrdering Ordering = GetDecodedOrdering(Record[OpNum+2]);
2959 SynchronizationScope SynchScope = GetDecodedSynchScope(Record[OpNum+3]);
2960 if (Ordering != NotAtomic && Record[OpNum] == 0)
2963 I = new StoreInst(Val, Ptr, Record[OpNum+1], (1 << Record[OpNum]) >> 1,
2973 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
2974 popValue(Record, OpNum, NextValueNo,
2976 popValue(Record, OpNum, NextValueNo,
2978 (Record.size() < OpNum + 3 || Record.size() > OpNum + 5))
2980 AtomicOrdering SuccessOrdering = GetDecodedOrdering(Record[OpNum+1]);
2983 SynchronizationScope SynchScope = GetDecodedSynchScope(Record[OpNum+2]);
2986 if (Record.size() < 7)
2990 FailureOrdering = GetDecodedOrdering(Record[OpNum+3]);
2994 cast<AtomicCmpXchgInst>(I)->setVolatile(Record[OpNum]);
2996 if (Record.size() < 8) {
3003 cast<AtomicCmpXchgInst>(I)->setWeak(Record[OpNum+4]);
3013 if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
3014 popValue(Record, OpNum, NextValueNo,
3016 OpNum+4 != Record.size())
3018 AtomicRMWInst::BinOp Operation = GetDecodedRMWOperation(Record[OpNum]);
3022 AtomicOrdering Ordering = GetDecodedOrdering(Record[OpNum+2]);
3025 SynchronizationScope SynchScope = GetDecodedSynchScope(Record[OpNum+3]);
3027 cast<AtomicRMWInst>(I)->setVolatile(Record[OpNum+1]);
3032 if (2 != Record.size())
3034 AtomicOrdering Ordering = GetDecodedOrdering(Record[0]);
3038 SynchronizationScope SynchScope = GetDecodedSynchScope(Record[1]);
3045 if (Record.size() < 3)
3048 AttributeSet PAL = getAttributes(Record[0]);
3049 unsigned CCInfo = Record[1];
3053 if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
3059 if (!FTy || Record.size() < FTy->getNumParams()+OpNum)
3066 Args.push_back(getBasicBlock(Record[OpNum]));
3068 Args.push_back(getValue(Record, OpNum, NextValueNo,
3076 if (OpNum != Record.size())
3079 while (OpNum != Record.size()) {
3081 if (getValueTypePair(Record, OpNum, NextValueNo, Op))
3101 if (Record.size() < 3)
3103 Type *OpTy = getTypeByID(Record[0]);
3104 Value *Op = getValue(Record, 1, NextValueNo, OpTy);
3105 Type *ResTy = getTypeByID(Record[2]);
3274 // pointing to the END_BLOCK record after them. Now make sure the rest
3387 return "Invalid record";