summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-01-03 16:52:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-01-03 16:52:15 +0000
commit49422f341aabe2e519da58d24009ebeface93415 (patch)
treebe9fc78132731a6530da1cf2ed42f379a9f1bd7d
parentcc333d7400f8485141c8aa36dc2d51e1738c5e9c (diff)
downloadbcm5719-llvm-49422f341aabe2e519da58d24009ebeface93415.tar.gz
bcm5719-llvm-49422f341aabe2e519da58d24009ebeface93415.zip
Use a switch. NFC.
llvm-svn: 321737
-rw-r--r--lld/ELF/Relocations.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 8c8347cf327..6eaab623077 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -396,15 +396,18 @@ static bool isStaticLinkTimeConstant(RelExpr E, RelType Type, const Symbol &Sym,
}
static RelExpr toPlt(RelExpr Expr) {
- if (Expr == R_PPC_OPD)
+ switch (Expr) {
+ case R_PPC_OPD:
return R_PPC_PLT_OPD;
- if (Expr == R_PC)
+ case R_PC:
return R_PLT_PC;
- if (Expr == R_PAGE_PC)
+ case R_PAGE_PC:
return R_PLT_PAGE_PC;
- if (Expr == R_ABS)
+ case R_ABS:
return R_PLT;
- return Expr;
+ default:
+ return Expr;
+ }
}
static RelExpr fromPlt(RelExpr Expr) {
OpenPOWER on IntegriCloud