forked from OSchip/llvm-project
[Mach-O] Rename enum typename for consistency. NFC
Typename shouldn't mix camel case and underscore. Thanks to Rui for the remark. llvm-svn: 229848
This commit is contained in:
parent
8817e5e01b
commit
c31da7010b
|
@ -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(const Reference &ref, uint8_t *loc,
|
|||
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::applyFixupRelocatable(const Reference &ref, uint8_t *loc,
|
|||
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::appendSectionRelocations(
|
|||
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:
|
||||
|
|
|
@ -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::setDisplacementInADRP(uint32_t instruction,
|
|||
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(const Reference &ref, uint8_t *loc,
|
|||
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::applyFixupRelocatable(const Reference &ref,
|
|||
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::appendSectionRelocations(
|
|||
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,
|
||||
|
|
|
@ -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(const Reference &ref, uint8_t *loc,
|
|||
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::applyFixupRelocatable(const Reference &ref,
|
|||
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::appendSectionRelocations(
|
|||
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;
|
||||
|
|
|
@ -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::applyFixupRelocatable(const Reference &ref,
|
|||
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::appendSectionRelocations(
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue