From f32b3b5783908ddbf1f7d1690106d22328a74758 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 17 Jun 2017 12:48:31 +0000 Subject: [PATCH] Repair a few mismerges in r320041 and r320042. --- .../llvm/lib/CodeGen/XRayInstrumentation.cpp | 6 ++-- contrib/llvm/tools/lld/ELF/InputSection.cpp | 32 ------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp b/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp index 0b4c6e551667..1a8d5a4f45da 100644 --- a/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp +++ b/contrib/llvm/lib/CodeGen/XRayInstrumentation.cpp @@ -142,9 +142,9 @@ bool XRayInstrumentation::runOnMachineFunction(MachineFunction &MF) { return false; // Invalid value for threshold. // Count the number of MachineInstr`s in MachineFunction - int64_t MICount = 0; - for (const auto& MBB : MF) - MICount += MBB.size(); + int64_t MICount = 0; + for (const auto& MBB : MF) + MICount += MBB.size(); // Check if we have a loop. // FIXME: Maybe make this smarter, and see whether the loops are dependent diff --git a/contrib/llvm/tools/lld/ELF/InputSection.cpp b/contrib/llvm/tools/lld/ELF/InputSection.cpp index eb084f18daaf..9aae82bc2992 100644 --- a/contrib/llvm/tools/lld/ELF/InputSection.cpp +++ b/contrib/llvm/tools/lld/ELF/InputSection.cpp @@ -467,7 +467,6 @@ static uint64_t getRelocTargetVA(uint32_t Type, int64_t A, uint64_t P, case R_GOTREL_FROM_END: return Body.getVA(A) - InX::Got->getVA() - InX::Got->getSize(); case R_GOT_FROM_END: - case R_GOT_FROM_END: case R_RELAX_TLS_GD_TO_IE_END: return Body.getGotOffset() + A - InX::Got->getSize(); case R_GOT_OFF: @@ -476,7 +475,6 @@ static uint64_t getRelocTargetVA(uint32_t Type, int64_t A, uint64_t P, case R_RELAX_TLS_GD_TO_IE_PAGE_PC: return getAArch64Page(Body.getGotVA() + A) - getAArch64Page(P); case R_GOT_PC: - case R_GOT_PC: case R_RELAX_TLS_GD_TO_IE: return Body.getGotVA() + A - P; case R_HINT: @@ -546,36 +544,6 @@ static uint64_t getRelocTargetVA(uint32_t Type, int64_t A, uint64_t P, case R_PLT_PC: case R_PPC_PLT_OPD: return Body.getPltVA() + A - P; - case R_PAGE_PC: - case R_PLT_PAGE_PC: { - uint64_t Dest; - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) - Dest = getAArch64Page(A); - else - Dest = getAArch64Page(Body.getVA(A)); - return Dest - getAArch64Page(P); - } - case R_PC: { - uint64_t Dest; - if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak()) { - // On ARM and AArch64 a branch to an undefined weak resolves to the - // next instruction, otherwise the place. - if (Config->EMachine == EM_ARM) - Dest = getARMUndefinedRelativeWeakVA(Type, A, P); - else if (Config->EMachine == EM_AARCH64) - Dest = getAArch64UndefinedRelativeWeakVA(Type, A, P); - else - Dest = Body.getVA(A); - } else { - Dest = Body.getVA(A); - } - return Dest - P; - } - case R_PLT: - return Body.getPltVA() + A; - case R_PLT_PC: - case R_PPC_PLT_OPD: - return Body.getPltVA() + A - P; case R_PPC_OPD: { uint64_t SymVA = Body.getVA(A); // If we have an undefined weak symbol, we might get here with a symbol