[llvm] r263872 - [gold] Use early return to simplify.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 18 19:34:34 PDT 2016
Author: davide
Date: Fri Mar 18 21:34:33 2016
New Revision: 263872
URL: http://llvm.org/viewvc/llvm-project?rev=263872&view=rev
Log:
[gold] Use early return to simplify.
Modified:
llvm/trunk/tools/gold/gold-plugin.cpp
Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=263872&r1=263871&r2=263872&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Fri Mar 18 21:34:33 2016
@@ -901,22 +901,17 @@ static SubtargetFeatures getFeatures(Tri
}
static CodeGenOpt::Level getCGOptLevel() {
- CodeGenOpt::Level CGOptLevel;
switch (options::OptLevel) {
case 0:
- CGOptLevel = CodeGenOpt::None;
- break;
+ return CodeGenOpt::None;
case 1:
- CGOptLevel = CodeGenOpt::Less;
- break;
+ return CodeGenOpt::Less;
case 2:
- CGOptLevel = CodeGenOpt::Default;
- break;
+ return CodeGenOpt::Default;
case 3:
- CGOptLevel = CodeGenOpt::Aggressive;
- break;
+ return CodeGenOpt::Aggressive;
}
- return CGOptLevel;
+ llvm_unreachable("Invalid optimization level");
}
void CodeGen::initTargetMachine() {
More information about the llvm-commits
mailing list