diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-03 16:29:43 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-03 16:29:43 +0000 |
| commit | 6e102b2fc62bb0141a6cfa223492458ae240d357 (patch) | |
| tree | 7640990977c3ffa2f3e8137b51cef579c7893af0 | |
| parent | 28aa6e2bc520d92650f50919863d79b2576ba018 (diff) | |
| download | bcm5719-llvm-6e102b2fc62bb0141a6cfa223492458ae240d357.tar.gz bcm5719-llvm-6e102b2fc62bb0141a6cfa223492458ae240d357.zip | |
Use a swtich. NFC.
llvm-svn: 321734
| -rw-r--r-- | lld/ELF/Relocations.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 3e5e7a83acb..f22ca683cf6 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -410,13 +410,16 @@ static RelExpr toPlt(RelExpr Expr) { static RelExpr fromPlt(RelExpr Expr) { // We decided not to use a plt. Optimize a reference to the plt to a // reference to the symbol itself. - if (Expr == R_PLT_PC) + switch (Expr) { + case R_PLT_PC: return R_PC; - if (Expr == R_PPC_PLT_OPD) + case R_PPC_PLT_OPD: return R_PPC_OPD; - if (Expr == R_PLT) + case R_PLT: return R_ABS; - return Expr; + default: + return Expr; + } } // Returns true if a given shared symbol is in a read-only segment in a DSO. |

