1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Use an "early return" idiom for the error case. NFC

llvm-svn: 236080
This commit is contained in:
Filipe Cabecinhas 2015-04-29 02:36:08 +00:00
parent 1e65e2471f
commit 1f65414d43

View File

@ -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;
}