summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-03-19 02:34:33 +0000
committerDavide Italiano <davide@freebsd.org>2016-03-19 02:34:33 +0000
commit2788a825e7a2841bbf5d38d42ba1583dd2747f99 (patch)
tree973f14b5f4f454049dc39d238f7fb8699869ad36 /llvm/tools
parentee42b3d97cb3c73501cda01284b0fd63940a442f (diff)
downloadbcm5719-llvm-2788a825e7a2841bbf5d38d42ba1583dd2747f99.tar.gz
bcm5719-llvm-2788a825e7a2841bbf5d38d42ba1583dd2747f99.zip
[gold] Use early return to simplify.
llvm-svn: 263872
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 369e2fbee22..57026f8d0ef 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -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() {
OpenPOWER on IntegriCloud