[lld] r229848 - [Mach-O] Rename enum typename for consistency. NFC
Jean-Daniel Dupas
devlists at shadowlab.org
Thu Feb 19 04:38:55 PST 2015
Author: jddupas
Date: Thu Feb 19 06:38:54 2015
New Revision: 229848
URL: http://llvm.org/viewvc/llvm-project?rev=229848&view=rev
Log:
[Mach-O] Rename enum typename for consistency. NFC
Typename shouldn't mix camel case and underscore.
Thanks to Rui for the remark.
Modified:
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp?rev=229848&r1=229847&r2=229848&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp Thu Feb 19 06:38:54 2015
@@ -138,7 +138,7 @@ private:
static const Registry::KindStrings _sKindStrings[];
static const StubInfo _sStubInfoArmPIC;
- enum Arm_Kinds : Reference::KindValue {
+ enum ArmKind : Reference::KindValue {
invalid, /// for error condition
modeThumbCode, /// Content starting at this offset is thumb.
@@ -913,7 +913,7 @@ void ArchHandler_arm::applyFixupFinal(co
int32_t displacement;
uint16_t value16;
uint32_t value32;
- switch (static_cast<Arm_Kinds>(ref.kindValue())) {
+ switch (static_cast<ArmKind>(ref.kindValue())) {
case modeThumbCode:
thumbMode = true;
break;
@@ -1078,7 +1078,7 @@ void ArchHandler_arm::applyFixupRelocata
uint16_t value16;
uint32_t value32;
bool targetIsUndef = isa<UndefinedAtom>(ref.target());
- switch (static_cast<Arm_Kinds>(ref.kindValue())) {
+ switch (static_cast<ArmKind>(ref.kindValue())) {
case modeThumbCode:
thumbMode = true;
break;
@@ -1194,7 +1194,7 @@ void ArchHandler_arm::appendSectionReloc
uint32_t targetAtomAddress;
uint32_t fromAtomAddress;
uint16_t other16;
- switch (static_cast<Arm_Kinds>(ref.kindValue())) {
+ switch (static_cast<ArmKind>(ref.kindValue())) {
case modeThumbCode:
case modeArmCode:
case modeData:
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp?rev=229848&r1=229847&r2=229848&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp Thu Feb 19 06:38:54 2015
@@ -161,7 +161,7 @@ private:
static const Registry::KindStrings _sKindStrings[];
static const StubInfo _sStubInfo;
- enum Arm64_Kinds : Reference::KindValue {
+ enum Arm64Kind : Reference::KindValue {
invalid, /// for error condition
// Kinds found in mach-o .o files:
@@ -209,7 +209,7 @@ private:
// Utility functions for inspecting/updating instructions.
static uint32_t setDisplacementInBranch26(uint32_t instr, int32_t disp);
static uint32_t setDisplacementInADRP(uint32_t instr, int64_t disp);
- static Arm64_Kinds offset12KindFromInstruction(uint32_t instr);
+ static Arm64Kind offset12KindFromInstruction(uint32_t instr);
static uint32_t setImm12(uint32_t instr, uint32_t offset);
};
@@ -328,7 +328,7 @@ uint32_t ArchHandler_arm64::setDisplacem
return (instruction & 0x9F00001F) | immlo | immhi;
}
-ArchHandler_arm64::Arm64_Kinds
+ArchHandler_arm64::Arm64Kind
ArchHandler_arm64::offset12KindFromInstruction(uint32_t instruction) {
if (instruction & 0x08000000) {
switch ((instruction >> 30) & 0x3) {
@@ -537,7 +537,7 @@ void ArchHandler_arm64::applyFixupFinal(
uint32_t instruction;
uint32_t value32;
uint32_t value64;
- switch (static_cast<Arm64_Kinds>(ref.kindValue())) {
+ switch (static_cast<Arm64Kind>(ref.kindValue())) {
case branch26:
displacement = (targetAddress - fixupAddress) + ref.addend();
*loc32 = setDisplacementInBranch26(*loc32, displacement);
@@ -638,7 +638,7 @@ void ArchHandler_arm64::applyFixupReloca
assert(ref.kindArch() == Reference::KindArch::AArch64);
ulittle32_t *loc32 = reinterpret_cast<ulittle32_t *>(loc);
ulittle64_t *loc64 = reinterpret_cast<ulittle64_t *>(loc);
- switch (static_cast<Arm64_Kinds>(ref.kindValue())) {
+ switch (static_cast<Arm64Kind>(ref.kindValue())) {
case branch26:
*loc32 = setDisplacementInBranch26(*loc32, 0);
return;
@@ -706,7 +706,7 @@ void ArchHandler_arm64::appendSectionRel
return;
assert(ref.kindArch() == Reference::KindArch::AArch64);
uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom();
- switch (static_cast<Arm64_Kinds>(ref.kindValue())) {
+ switch (static_cast<Arm64Kind>(ref.kindValue())) {
case branch26:
if (ref.addend()) {
appendReloc(relocs, sectionOffset, ref.addend(), 0,
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp?rev=229848&r1=229847&r2=229848&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp Thu Feb 19 06:38:54 2015
@@ -133,7 +133,7 @@ private:
static const Registry::KindStrings _sKindStrings[];
static const StubInfo _sStubInfo;
- enum X86_Kinds : Reference::KindValue {
+ enum X86Kind : Reference::KindValue {
invalid, /// for error condition
modeCode, /// Content starting at this offset is code.
@@ -441,7 +441,7 @@ void ArchHandler_x86::applyFixupFinal(co
return;
assert(ref.kindArch() == Reference::KindArch::x86);
ulittle32_t *loc32 = reinterpret_cast<ulittle32_t *>(loc);
- switch (static_cast<X86_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86Kind>(ref.kindValue())) {
case branch32:
*loc32 = (targetAddress - (fixupAddress + 4)) + ref.addend();
break;
@@ -486,7 +486,7 @@ void ArchHandler_x86::applyFixupRelocata
bool useExternalReloc = useExternalRelocationTo(*ref.target());
ulittle16_t *loc16 = reinterpret_cast<ulittle16_t *>(loc);
ulittle32_t *loc32 = reinterpret_cast<ulittle32_t *>(loc);
- switch (static_cast<X86_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86Kind>(ref.kindValue())) {
case branch32:
if (useExternalReloc)
*loc32 = ref.addend() - (fixupAddress + 4);
@@ -559,7 +559,7 @@ void ArchHandler_x86::appendSectionReloc
assert(ref.kindArch() == Reference::KindArch::x86);
uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom();
bool useExternalReloc = useExternalRelocationTo(*ref.target());
- switch (static_cast<X86_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86Kind>(ref.kindValue())) {
case modeCode:
case modeData:
break;
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp?rev=229848&r1=229847&r2=229848&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp Thu Feb 19 06:38:54 2015
@@ -158,7 +158,7 @@ private:
static const Registry::KindStrings _sKindStrings[];
static const StubInfo _sStubInfo;
- enum X86_64_Kinds: Reference::KindValue {
+ enum X86_64Kind: Reference::KindValue {
invalid, /// for error condition
// Kinds found in mach-o .o files:
@@ -480,7 +480,7 @@ void ArchHandler_x86_64::applyFixupFinal
assert(ref.kindArch() == Reference::KindArch::x86_64);
ulittle32_t *loc32 = reinterpret_cast<ulittle32_t *>(loc);
ulittle64_t *loc64 = reinterpret_cast<ulittle64_t *>(loc);
- switch (static_cast<X86_64_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86_64Kind>(ref.kindValue())) {
case branch32:
case ripRel32:
case ripRel32Anon:
@@ -553,7 +553,7 @@ void ArchHandler_x86_64::applyFixupReloc
assert(ref.kindArch() == Reference::KindArch::x86_64);
ulittle32_t *loc32 = reinterpret_cast<ulittle32_t *>(loc);
ulittle64_t *loc64 = reinterpret_cast<ulittle64_t *>(loc);
- switch (static_cast<X86_64_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86_64Kind>(ref.kindValue())) {
case branch32:
case ripRel32:
case ripRel32Got:
@@ -627,7 +627,7 @@ void ArchHandler_x86_64::appendSectionRe
return;
assert(ref.kindArch() == Reference::KindArch::x86_64);
uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom();
- switch (static_cast<X86_64_Kinds>(ref.kindValue())) {
+ switch (static_cast<X86_64Kind>(ref.kindValue())) {
case branch32:
appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0,
X86_64_RELOC_BRANCH | rPcRel | rExtern | rLength4);
More information about the llvm-commits
mailing list