mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Use an "early return" idiom for the error case. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99ebc9e004
commit
fe7b873743
@ -1475,20 +1475,18 @@ std::error_code BitcodeReader::ParseTypeTableBody() {
|
|||||||
case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
|
case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
|
||||||
if (Record.size() < 2)
|
if (Record.size() < 2)
|
||||||
return Error("Invalid record");
|
return Error("Invalid record");
|
||||||
if ((ResultTy = getTypeByID(Record[1])) &&
|
ResultTy = getTypeByID(Record[1]);
|
||||||
ArrayType::isValidElementType(ResultTy))
|
if (!ResultTy || !ArrayType::isValidElementType(ResultTy))
|
||||||
ResultTy = ArrayType::get(ResultTy, Record[0]);
|
|
||||||
else
|
|
||||||
return Error("Invalid type");
|
return Error("Invalid type");
|
||||||
|
ResultTy = ArrayType::get(ResultTy, Record[0]);
|
||||||
break;
|
break;
|
||||||
case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
|
case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
|
||||||
if (Record.size() < 2)
|
if (Record.size() < 2)
|
||||||
return Error("Invalid record");
|
return Error("Invalid record");
|
||||||
if ((ResultTy = getTypeByID(Record[1])) &&
|
ResultTy = getTypeByID(Record[1]);
|
||||||
StructType::isValidElementType(ResultTy))
|
if (!ResultTy || !StructType::isValidElementType(ResultTy))
|
||||||
ResultTy = VectorType::get(ResultTy, Record[0]);
|
|
||||||
else
|
|
||||||
return Error("Invalid type");
|
return Error("Invalid type");
|
||||||
|
ResultTy = VectorType::get(ResultTy, Record[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user