@@ -37,7 +37,6 @@ Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
3737 if (!opts::EliminateVeneers || !BC.isAArch64 ())
3838 return Error::success ();
3939
40- std::map<uint64_t , BinaryFunction> &BFs = BC.getBinaryFunctions ();
4140 std::unordered_map<const MCSymbol *, const MCSymbol *> VeneerDestinations;
4241 uint64_t NumEliminatedVeneers = 0 ;
4342 for (BinaryFunction &BF : llvm::make_second_range (BC.getBinaryFunctions ())) {
@@ -47,17 +46,16 @@ Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
4746 if (BF.isIgnored ())
4847 continue ;
4948
50- MCInst &FirstInstruction = *(BF.begin ()->begin ());
5149 const MCSymbol *VeneerTargetSymbol = 0 ;
5250 uint64_t TargetAddress;
5351 if (BC.MIB ->matchAbsLongVeneer (BF, TargetAddress)) {
5452 if (BinaryFunction *TargetBF =
5553 BC.getBinaryFunctionAtAddress (TargetAddress))
5654 VeneerTargetSymbol = TargetBF->getSymbol ();
5755 } else {
58- if (!BC. MIB -> hasAnnotation (FirstInstruction, " AArch64Veneer " ))
59- continue ;
60- VeneerTargetSymbol = BC.MIB ->getTargetSymbol (FirstInstruction, 1 );
56+ MCInst &FirstInstruction = *(BF. begin ()-> begin ());
57+ if (BC. MIB -> hasAnnotation (FirstInstruction, " AArch64Veneer " ))
58+ VeneerTargetSymbol = BC.MIB ->getTargetSymbol (FirstInstruction, 1 );
6159 }
6260
6361 if (!VeneerTargetSymbol)
@@ -84,9 +82,8 @@ Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
8482 }
8583
8684 uint64_t VeneerCallers = 0 ;
87- for (auto &It : BFs) {
88- BinaryFunction &Function = It.second ;
89- for (BinaryBasicBlock &BB : Function) {
85+ for (BinaryFunction &BF : llvm::make_second_range (BC.getBinaryFunctions ())) {
86+ for (BinaryBasicBlock &BB : BF) {
9087 for (MCInst &Instr : BB) {
9188 if (!BC.MIB ->isCall (Instr) || BC.MIB ->isIndirectCall (Instr))
9289 continue ;
0 commit comments