[llvm] r239228 - Use early return idiom. NFC
Filipe Cabecinhas
me at filcab.net
Sat Jun 6 13:44:53 PDT 2015
Author: filcab
Date: Sat Jun 6 15:44:53 2015
New Revision: 239228
URL: http://llvm.org/viewvc/llvm-project?rev=239228&view=rev
Log:
Use early return idiom. NFC
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=239228&r1=239227&r2=239228&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Sat Jun 6 15:44:53 2015
@@ -2065,13 +2065,13 @@ std::error_code BitcodeReader::ResolveGl
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();
}
More information about the llvm-commits
mailing list