Skip to content

Commit

Permalink
[gold] Use early return to simplify.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263872 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dcci committed Mar 19, 2016
1 parent 0dac9cf commit fef7414
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tools/gold/gold-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit fef7414

Please sign in to comment.