mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-31 10:34:17 +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]
|
||||
if (Record.size() < 2)
|
||||
return Error("Invalid record");
|
||||
if ((ResultTy = getTypeByID(Record[1])) &&
|
||||
ArrayType::isValidElementType(ResultTy))
|
||||
ResultTy = ArrayType::get(ResultTy, Record[0]);
|
||||
else
|
||||
ResultTy = getTypeByID(Record[1]);
|
||||
if (!ResultTy || !ArrayType::isValidElementType(ResultTy))
|
||||
return Error("Invalid type");
|
||||
ResultTy = ArrayType::get(ResultTy, Record[0]);
|
||||
break;
|
||||
case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
|
||||
if (Record.size() < 2)
|
||||
return Error("Invalid record");
|
||||
if ((ResultTy = getTypeByID(Record[1])) &&
|
||||
StructType::isValidElementType(ResultTy))
|
||||
ResultTy = VectorType::get(ResultTy, Record[0]);
|
||||
else
|
||||
ResultTy = getTypeByID(Record[1]);
|
||||
if (!ResultTy || !StructType::isValidElementType(ResultTy))
|
||||
return Error("Invalid type");
|
||||
ResultTy = VectorType::get(ResultTy, Record[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user