[NFC] Replace ".size() < 1" with ".empty()"
This commit is contained in:
@@ -1716,7 +1716,7 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||||||
case bitc::TYPE_CODE_NUMENTRY: // TYPE_CODE_NUMENTRY: [numentries]
|
case bitc::TYPE_CODE_NUMENTRY: // TYPE_CODE_NUMENTRY: [numentries]
|
||||||
// TYPE_CODE_NUMENTRY contains a count of the number of types in the
|
// TYPE_CODE_NUMENTRY contains a count of the number of types in the
|
||||||
// type list. This allows us to reserve space.
|
// type list. This allows us to reserve space.
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
TypeList.resize(Record[0]);
|
TypeList.resize(Record[0]);
|
||||||
continue;
|
continue;
|
||||||
@@ -1757,7 +1757,7 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||||||
ResultTy = Type::getTokenTy(Context);
|
ResultTy = Type::getTokenTy(Context);
|
||||||
break;
|
break;
|
||||||
case bitc::TYPE_CODE_INTEGER: { // INTEGER: [width]
|
case bitc::TYPE_CODE_INTEGER: { // INTEGER: [width]
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
|
|
||||||
uint64_t NumBits = Record[0];
|
uint64_t NumBits = Record[0];
|
||||||
@@ -1769,7 +1769,7 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||||||
}
|
}
|
||||||
case bitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or
|
case bitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or
|
||||||
// [pointee type, address space]
|
// [pointee type, address space]
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
unsigned AddressSpace = 0;
|
unsigned AddressSpace = 0;
|
||||||
if (Record.size() == 2)
|
if (Record.size() == 2)
|
||||||
@@ -1824,7 +1824,7 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case bitc::TYPE_CODE_STRUCT_ANON: { // STRUCT: [ispacked, eltty x N]
|
case bitc::TYPE_CODE_STRUCT_ANON: { // STRUCT: [ispacked, eltty x N]
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
SmallVector<Type*, 8> EltTys;
|
SmallVector<Type*, 8> EltTys;
|
||||||
for (unsigned i = 1, e = Record.size(); i != e; ++i) {
|
for (unsigned i = 1, e = Record.size(); i != e; ++i) {
|
||||||
@@ -1844,7 +1844,7 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case bitc::TYPE_CODE_STRUCT_NAMED: { // STRUCT: [ispacked, eltty x N]
|
case bitc::TYPE_CODE_STRUCT_NAMED: { // STRUCT: [ispacked, eltty x N]
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
|
|
||||||
if (NumRecords >= TypeList.size())
|
if (NumRecords >= TypeList.size())
|
||||||
@@ -3716,7 +3716,7 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
|
|||||||
break;
|
break;
|
||||||
/// MODULE_CODE_VSTOFFSET: [offset]
|
/// MODULE_CODE_VSTOFFSET: [offset]
|
||||||
case bitc::MODULE_CODE_VSTOFFSET:
|
case bitc::MODULE_CODE_VSTOFFSET:
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
// Note that we subtract 1 here because the offset is relative to one word
|
// Note that we subtract 1 here because the offset is relative to one word
|
||||||
// before the start of the identification or module block, which was
|
// before the start of the identification or module block, which was
|
||||||
@@ -3870,7 +3870,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
|||||||
default: // Default behavior: reject
|
default: // Default behavior: reject
|
||||||
return error("Invalid value");
|
return error("Invalid value");
|
||||||
case bitc::FUNC_CODE_DECLAREBLOCKS: { // DECLAREBLOCKS: [nblocks]
|
case bitc::FUNC_CODE_DECLAREBLOCKS: { // DECLAREBLOCKS: [nblocks]
|
||||||
if (Record.size() < 1 || Record[0] == 0)
|
if (Record.empty() || Record[0] == 0)
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
// Create all the basic blocks for the function.
|
// Create all the basic blocks for the function.
|
||||||
FunctionBBs.resize(Record[0]);
|
FunctionBBs.resize(Record[0]);
|
||||||
@@ -4712,7 +4712,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
|||||||
InstructionList.push_back(I);
|
InstructionList.push_back(I);
|
||||||
break;
|
break;
|
||||||
case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, val0,bb0, ...]
|
case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, val0,bb0, ...]
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
// The first record specifies the type.
|
// The first record specifies the type.
|
||||||
FullTy = getFullyStructuredTypeByID(Record[0]);
|
FullTy = getFullyStructuredTypeByID(Record[0]);
|
||||||
@@ -5205,7 +5205,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
|||||||
// number of operand bundle blocks. These blocks are read into
|
// number of operand bundle blocks. These blocks are read into
|
||||||
// OperandBundles and consumed at the next call or invoke instruction.
|
// OperandBundles and consumed at the next call or invoke instruction.
|
||||||
|
|
||||||
if (Record.size() < 1 || Record[0] >= BundleTags.size())
|
if (Record.empty() || Record[0] >= BundleTags.size())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
|
|
||||||
std::vector<Value *> Inputs;
|
std::vector<Value *> Inputs;
|
||||||
@@ -5738,7 +5738,7 @@ Error ModuleSummaryIndexBitcodeReader::parseModule() {
|
|||||||
}
|
}
|
||||||
/// MODULE_CODE_VSTOFFSET: [offset]
|
/// MODULE_CODE_VSTOFFSET: [offset]
|
||||||
case bitc::MODULE_CODE_VSTOFFSET:
|
case bitc::MODULE_CODE_VSTOFFSET:
|
||||||
if (Record.size() < 1)
|
if (Record.empty())
|
||||||
return error("Invalid record");
|
return error("Invalid record");
|
||||||
// Note that we subtract 1 here because the offset is relative to one
|
// Note that we subtract 1 here because the offset is relative to one
|
||||||
// word before the start of the identification or module block, which
|
// word before the start of the identification or module block, which
|
||||||
|
|||||||
Reference in New Issue
Block a user