[gold] Use early return to simplify.

llvm-svn: 263872
This commit is contained in:
Davide Italiano 2016-03-19 02:34:33 +00:00
parent ee42b3d97c
commit 2788a825e7
1 changed files with 5 additions and 10 deletions

View File

@ -901,22 +901,17 @@ static SubtargetFeatures getFeatures(Triple &TheTriple) {
}
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() {