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