[lld] r342686 - Make variable names shorter. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 20 14:29:14 PDT 2018
Author: ruiu
Date: Thu Sep 20 14:29:14 2018
New Revision: 342686
URL: http://llvm.org/viewvc/llvm-project?rev=342686&view=rev
Log:
Make variable names shorter. NFC.
Modified:
lld/trunk/ELF/Driver.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=342686&r1=342685&r2=342686&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Sep 20 14:29:14 2018
@@ -63,6 +63,7 @@ using namespace llvm;
using namespace llvm::ELF;
using namespace llvm::object;
using namespace llvm::sys;
+using namespace llvm::support;
using namespace lld;
using namespace lld::elf;
@@ -961,15 +962,14 @@ void LinkerDriver::readConfigs(opt::Inpu
// This function initialize such members. See Config.h for the details
// of these values.
static void setConfigs(opt::InputArgList &Args) {
- ELFKind Kind = Config->EKind;
- uint16_t Machine = Config->EMachine;
+ ELFKind K = Config->EKind;
+ uint16_t M = Config->EMachine;
Config->CopyRelocs = (Config->Relocatable || Config->EmitRelocs);
- Config->Is64 = (Kind == ELF64LEKind || Kind == ELF64BEKind);
- Config->IsLE = (Kind == ELF32LEKind || Kind == ELF64LEKind);
- Config->Endianness =
- Config->IsLE ? support::endianness::little : support::endianness::big;
- Config->IsMips64EL = (Kind == ELF64LEKind && Machine == EM_MIPS);
+ Config->Is64 = (K == ELF64LEKind || K == ELF64BEKind);
+ Config->IsLE = (K == ELF32LEKind || K == ELF64LEKind);
+ Config->Endianness = Config->IsLE ? endianness::little : endianness::big;
+ Config->IsMips64EL = (K == ELF64LEKind && M == EM_MIPS);
Config->Pic = Config->Pie || Config->Shared;
Config->Wordsize = Config->Is64 ? 8 : 4;
@@ -986,9 +986,8 @@ static void setConfigs(opt::InputArgList
// You cannot choose which one, Rel or Rela, you want to use. Instead each
// ABI defines which one you need to use. The following expression expresses
// that.
- Config->IsRela = Machine == EM_AARCH64 || Machine == EM_AMDGPU ||
- Machine == EM_PPC || Machine == EM_PPC64 ||
- Machine == EM_RISCV || Machine == EM_X86_64;
+ Config->IsRela = M == EM_AARCH64 || M == EM_AMDGPU || M == EM_PPC ||
+ M == EM_PPC64 || M == EM_RISCV || M == EM_X86_64;
// If the output uses REL relocations we must store the dynamic relocation
// addends to the output sections. We also store addends for RELA relocations
@@ -1000,7 +999,7 @@ static void setConfigs(opt::InputArgList
!Config->IsRela;
Config->TocOptimize =
- Args.hasFlag(OPT_toc_optimize, OPT_no_toc_optimize, Machine == EM_PPC64);
+ Args.hasFlag(OPT_toc_optimize, OPT_no_toc_optimize, M == EM_PPC64);
}
// Returns a value of "-format" option.
More information about the llvm-commits
mailing list