summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2019-07-10 05:00:37 +0000
committerRui Ueyama <ruiu@google.com>2019-07-10 05:00:37 +0000
commit3837f4273fcc40cc519035479aefe78e5cbd3055 (patch)
tree38a9202cec6963abe68d7c2ef6648e4cd2d48578 /lld/ELF/Target.cpp
parent21b28fb8c5fe32e38dcb2768aa8820fa7a51c522 (diff)
downloadbcm5719-llvm-3837f4273fcc40cc519035479aefe78e5cbd3055.tar.gz
bcm5719-llvm-3837f4273fcc40cc519035479aefe78e5cbd3055.zip
[Coding style change] Rename variables so that they start with a lowercase letter
This patch is mechanically generated by clang-llvm-rename tool that I wrote using Clang Refactoring Engine just for creating this patch. You can see the source code of the tool at https://reviews.llvm.org/D64123. There's no manual post-processing; you can generate the same patch by re-running the tool against lld's code base. Here is the main discussion thread to change the LLVM coding style: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130083.html In the discussion thread, I proposed we use lld as a testbed for variable naming scheme change, and this patch does that. I chose to rename variables so that they are in camelCase, just because that is a minimal change to make variables to start with a lowercase letter. Note to downstream patch maintainers: if you are maintaining a downstream lld repo, just rebasing ahead of this commit would cause massive merge conflicts because this patch essentially changes every line in the lld subdirectory. But there's a remedy. clang-llvm-rename tool is a batch tool, so you can rename variables in your downstream repo with the tool. Given that, here is how to rebase your repo to a commit after the mass renaming: 1. rebase to the commit just before the mass variable renaming, 2. apply the tool to your downstream repo to mass-rename variables locally, and 3. rebase again to the head. Most changes made by the tool should be identical for a downstream repo and for the head, so at the step 3, almost all changes should be merged and disappear. I'd expect that there would be some lines that you need to merge by hand, but that shouldn't be too many. Differential Revision: https://reviews.llvm.org/D64121 llvm-svn: 365595
Diffstat (limited to 'lld/ELF/Target.cpp')
-rw-r--r--lld/ELF/Target.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 373e9c3d731..d07478a5178 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -37,17 +37,17 @@ using namespace llvm::ELF;
using namespace lld;
using namespace lld::elf;
-const TargetInfo *elf::Target;
+const TargetInfo *elf::target;
-std::string lld::toString(RelType Type) {
- StringRef S = getELFRelocationTypeName(elf::Config->EMachine, Type);
- if (S == "Unknown")
- return ("Unknown (" + Twine(Type) + ")").str();
- return S;
+std::string lld::toString(RelType type) {
+ StringRef s = getELFRelocationTypeName(elf::config->emachine, type);
+ if (s == "Unknown")
+ return ("Unknown (" + Twine(type) + ")").str();
+ return s;
}
TargetInfo *elf::getTarget() {
- switch (Config->EMachine) {
+ switch (config->emachine) {
case EM_386:
case EM_IAMCU:
return getX86TargetInfo();
@@ -62,7 +62,7 @@ TargetInfo *elf::getTarget() {
case EM_HEXAGON:
return getHexagonTargetInfo();
case EM_MIPS:
- switch (Config->EKind) {
+ switch (config->ekind) {
case ELF32LEKind:
return getMipsTargetInfo<ELF32LE>();
case ELF32BEKind:
@@ -90,29 +90,29 @@ TargetInfo *elf::getTarget() {
llvm_unreachable("unknown target machine");
}
-template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *Loc) {
- for (InputSectionBase *D : InputSections) {
- auto *IS = cast<InputSection>(D);
- if (!IS->getParent())
+template <class ELFT> static ErrorPlace getErrPlace(const uint8_t *loc) {
+ for (InputSectionBase *d : inputSections) {
+ auto *isec = cast<InputSection>(d);
+ if (!isec->getParent())
continue;
- uint8_t *ISLoc = Out::BufferStart + IS->getParent()->Offset + IS->OutSecOff;
- if (ISLoc <= Loc && Loc < ISLoc + IS->getSize())
- return {IS, IS->template getLocation<ELFT>(Loc - ISLoc) + ": "};
+ uint8_t *isecLoc = Out::bufferStart + isec->getParent()->offset + isec->outSecOff;
+ if (isecLoc <= loc && loc < isecLoc + isec->getSize())
+ return {isec, isec->template getLocation<ELFT>(loc - isecLoc) + ": "};
}
return {};
}
-ErrorPlace elf::getErrorPlace(const uint8_t *Loc) {
- switch (Config->EKind) {
+ErrorPlace elf::getErrorPlace(const uint8_t *loc) {
+ switch (config->ekind) {
case ELF32LEKind:
- return getErrPlace<ELF32LE>(Loc);
+ return getErrPlace<ELF32LE>(loc);
case ELF32BEKind:
- return getErrPlace<ELF32BE>(Loc);
+ return getErrPlace<ELF32BE>(loc);
case ELF64LEKind:
- return getErrPlace<ELF64LE>(Loc);
+ return getErrPlace<ELF64LE>(loc);
case ELF64BEKind:
- return getErrPlace<ELF64BE>(Loc);
+ return getErrPlace<ELF64BE>(loc);
default:
llvm_unreachable("unknown ELF type");
}
@@ -120,62 +120,62 @@ ErrorPlace elf::getErrorPlace(const uint8_t *Loc) {
TargetInfo::~TargetInfo() {}
-int64_t TargetInfo::getImplicitAddend(const uint8_t *Buf, RelType Type) const {
+int64_t TargetInfo::getImplicitAddend(const uint8_t *buf, RelType type) const {
return 0;
}
-bool TargetInfo::usesOnlyLowPageBits(RelType Type) const { return false; }
+bool TargetInfo::usesOnlyLowPageBits(RelType type) const { return false; }
-bool TargetInfo::needsThunk(RelExpr Expr, RelType Type, const InputFile *File,
- uint64_t BranchAddr, const Symbol &S) const {
+bool TargetInfo::needsThunk(RelExpr expr, RelType type, const InputFile *file,
+ uint64_t branchAddr, const Symbol &s) const {
return false;
}
-bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *Loc, uint8_t *End,
- uint8_t StOther) const {
+bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
+ uint8_t stOther) const {
llvm_unreachable("Target doesn't support split stacks.");
}
-bool TargetInfo::inBranchRange(RelType Type, uint64_t Src, uint64_t Dst) const {
+bool TargetInfo::inBranchRange(RelType type, uint64_t src, uint64_t dst) const {
return true;
}
-void TargetInfo::writeIgotPlt(uint8_t *Buf, const Symbol &S) const {
- writeGotPlt(Buf, S);
+void TargetInfo::writeIgotPlt(uint8_t *buf, const Symbol &s) const {
+ writeGotPlt(buf, s);
}
-RelExpr TargetInfo::adjustRelaxExpr(RelType Type, const uint8_t *Data,
- RelExpr Expr) const {
- return Expr;
+RelExpr TargetInfo::adjustRelaxExpr(RelType type, const uint8_t *data,
+ RelExpr expr) const {
+ return expr;
}
-void TargetInfo::relaxGot(uint8_t *Loc, RelType Type, uint64_t Val) const {
+void TargetInfo::relaxGot(uint8_t *loc, RelType type, uint64_t val) const {
llvm_unreachable("Should not have claimed to be relaxable");
}
-void TargetInfo::relaxTlsGdToLe(uint8_t *Loc, RelType Type,
- uint64_t Val) const {
+void TargetInfo::relaxTlsGdToLe(uint8_t *loc, RelType type,
+ uint64_t val) const {
llvm_unreachable("Should not have claimed to be relaxable");
}
-void TargetInfo::relaxTlsGdToIe(uint8_t *Loc, RelType Type,
- uint64_t Val) const {
+void TargetInfo::relaxTlsGdToIe(uint8_t *loc, RelType type,
+ uint64_t val) const {
llvm_unreachable("Should not have claimed to be relaxable");
}
-void TargetInfo::relaxTlsIeToLe(uint8_t *Loc, RelType Type,
- uint64_t Val) const {
+void TargetInfo::relaxTlsIeToLe(uint8_t *loc, RelType type,
+ uint64_t val) const {
llvm_unreachable("Should not have claimed to be relaxable");
}
-void TargetInfo::relaxTlsLdToLe(uint8_t *Loc, RelType Type,
- uint64_t Val) const {
+void TargetInfo::relaxTlsLdToLe(uint8_t *loc, RelType type,
+ uint64_t val) const {
llvm_unreachable("Should not have claimed to be relaxable");
}
uint64_t TargetInfo::getImageBase() const {
// Use -image-base if set. Fall back to the target default if not.
- if (Config->ImageBase)
- return *Config->ImageBase;
- return Config->Pic ? 0 : DefaultImageBase;
+ if (config->imageBase)
+ return *config->imageBase;
+ return config->isPic ? 0 : defaultImageBase;
}
OpenPOWER on IntegriCloud