Use early return idiom. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239228 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Filipe Cabecinhas 2015-06-06 20:44:53 +00:00
parent 2ca8f0f5d6
commit ce986b6bc0

View File

@ -2065,13 +2065,13 @@ std::error_code BitcodeReader::ResolveGlobalAndAliasInits() {
if (ValID >= ValueList.size()) {
AliasInits.push_back(AliasInitWorklist.back());
} else {
if (Constant *C = dyn_cast_or_null<Constant>(ValueList[ValID])) {
GlobalAlias *Alias = AliasInitWorklist.back().first;
if (C->getType() != Alias->getType())
return Error("Alias and aliasee types don't match");
Alias->setAliasee(C);
} else
Constant *C = dyn_cast_or_null<Constant>(ValueList[ValID]);
if (!C)
return Error("Expected a constant");
GlobalAlias *Alias = AliasInitWorklist.back().first;
if (C->getType() != Alias->getType())
return Error("Alias and aliasee types don't match");
Alias->setAliasee(C);
}
AliasInitWorklist.pop_back();
}