@@ -148,11 +148,6 @@ class BinaryFunction {
148148 PF_MEMEVENT = 4 , // / Profile has mem events.
149149 };
150150
151- void setContainedNegateRAState () { HadNegateRAState = true ; }
152- bool containedNegateRAState () const { return HadNegateRAState; }
153- void setInitialRAState (bool State) { InitialRAState = State; }
154- bool getInitialRAState () { return InitialRAState; }
155-
156151 // / Struct for tracking exception handling ranges.
157152 struct CallSite {
158153 const MCSymbol *Start;
@@ -223,12 +218,6 @@ class BinaryFunction {
223218 // / Current state of the function.
224219 State CurrentState{State::Empty};
225220
226- // / Indicates if the Function contained .cfi-negate-ra-state. These are not
227- // / read from the binary. This boolean is used when deciding to run the
228- // / .cfi-negate-ra-state rewriting passes on a function or not.
229- bool HadNegateRAState{false };
230- bool InitialRAState{false };
231-
232221 // / A list of symbols associated with the function entry point.
233222 // /
234223 // / Multiple symbols would typically result from identical code-folding
@@ -1651,51 +1640,6 @@ class BinaryFunction {
16511640
16521641 void setHasInferredProfile (bool Inferred) { HasInferredProfile = Inferred; }
16531642
1654- // / Find corrected offset the same way addCFIInstruction does it to skip NOPs.
1655- std::optional<uint64_t > getCorrectedCFIOffset (uint64_t Offset) {
1656- assert (!Instructions.empty ());
1657- auto I = Instructions.lower_bound (Offset);
1658- if (Offset == getSize ()) {
1659- assert (I == Instructions.end () && " unexpected iterator value" );
1660- // Sometimes compiler issues restore_state after all instructions
1661- // in the function (even after nop).
1662- --I;
1663- Offset = I->first ;
1664- }
1665- assert (I->first == Offset && " CFI pointing to unknown instruction" );
1666- if (I == Instructions.begin ())
1667- return {};
1668-
1669- --I;
1670- while (I != Instructions.begin () && BC.MIB ->isNoop (I->second )) {
1671- Offset = I->first ;
1672- --I;
1673- }
1674- return Offset;
1675- }
1676-
1677- void setInstModifiesRAState (uint8_t CFIOpcode, uint64_t Offset) {
1678- std::optional<uint64_t > CorrectedOffset = getCorrectedCFIOffset (Offset);
1679- if (CorrectedOffset) {
1680- auto I = Instructions.lower_bound (*CorrectedOffset);
1681- I--;
1682-
1683- switch (CFIOpcode) {
1684- case dwarf::DW_CFA_AARCH64_negate_ra_state:
1685- BC.MIB ->setNegateRAState (I->second );
1686- break ;
1687- case dwarf::DW_CFA_remember_state:
1688- BC.MIB ->setRememberState (I->second );
1689- break ;
1690- case dwarf::DW_CFA_restore_state:
1691- BC.MIB ->setRestoreState (I->second );
1692- break ;
1693- default :
1694- assert (0 && " CFI Opcode not covered by function" );
1695- }
1696- }
1697- }
1698-
16991643 void addCFIInstruction (uint64_t Offset, MCCFIInstruction &&Inst) {
17001644 assert (!Instructions.empty ());
17011645
0 commit comments