@@ -818,16 +818,15 @@ void DstStatePrinter::print(raw_ostream &OS, const DstState &S) const {
818
818
// / version for functions without reconstructed CFG.
819
819
class DstSafetyAnalysis {
820
820
public:
821
- DstSafetyAnalysis (BinaryFunction &BF,
822
- const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
821
+ DstSafetyAnalysis (BinaryFunction &BF, ArrayRef<MCPhysReg> RegsToTrackInstsFor)
823
822
: BC(BF.getBinaryContext()), NumRegs(BC.MRI->getNumRegs ()),
824
823
RegsToTrackInstsFor(RegsToTrackInstsFor) {}
825
824
826
825
virtual ~DstSafetyAnalysis () {}
827
826
828
827
static std::shared_ptr<DstSafetyAnalysis>
829
828
create (BinaryFunction &BF, MCPlusBuilder::AllocatorIdTy AllocId,
830
- const ArrayRef<MCPhysReg> RegsToTrackInstsFor);
829
+ ArrayRef<MCPhysReg> RegsToTrackInstsFor);
831
830
832
831
virtual void run () = 0;
833
832
virtual const DstState &getStateAfter (const MCInst &Inst) const = 0;
@@ -1030,7 +1029,7 @@ class DataflowDstSafetyAnalysis
1030
1029
public:
1031
1030
DataflowDstSafetyAnalysis (BinaryFunction &BF,
1032
1031
MCPlusBuilder::AllocatorIdTy AllocId,
1033
- const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1032
+ ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1034
1033
: DstSafetyAnalysis(BF, RegsToTrackInstsFor), DFParent(BF, AllocId) {}
1035
1034
1036
1035
const DstState &getStateAfter (const MCInst &Inst) const override {
@@ -1114,7 +1113,7 @@ class CFGUnawareDstSafetyAnalysis : public DstSafetyAnalysis {
1114
1113
public:
1115
1114
CFGUnawareDstSafetyAnalysis (BinaryFunction &BF,
1116
1115
MCPlusBuilder::AllocatorIdTy AllocId,
1117
- const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1116
+ ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1118
1117
: DstSafetyAnalysis(BF, RegsToTrackInstsFor), BF(BF), AllocId(AllocId) {
1119
1118
StateAnnotationIndex =
1120
1119
BC.MIB ->getOrCreateAnnotationIndex (" CFGUnawareDstSafetyAnalysis" );
@@ -1157,7 +1156,7 @@ class CFGUnawareDstSafetyAnalysis : public DstSafetyAnalysis {
1157
1156
std::shared_ptr<DstSafetyAnalysis>
1158
1157
DstSafetyAnalysis::create (BinaryFunction &BF,
1159
1158
MCPlusBuilder::AllocatorIdTy AllocId,
1160
- const ArrayRef<MCPhysReg> RegsToTrackInstsFor) {
1159
+ ArrayRef<MCPhysReg> RegsToTrackInstsFor) {
1161
1160
if (BF.hasCFG ())
1162
1161
return std::make_shared<DataflowDstSafetyAnalysis>(BF, AllocId,
1163
1162
RegsToTrackInstsFor);
@@ -1391,7 +1390,7 @@ void FunctionAnalysis::findUnsafeDefs(
1391
1390
}
1392
1391
1393
1392
void FunctionAnalysis::augmentUnsafeDefReports (
1394
- const ArrayRef<BriefReport<MCPhysReg>> Reports) {
1393
+ ArrayRef<BriefReport<MCPhysReg>> Reports) {
1395
1394
SmallVector<MCPhysReg> RegsToTrack = collectRegsToTrack (Reports);
1396
1395
// Re-compute the analysis with register tracking.
1397
1396
auto Analysis = DstSafetyAnalysis::create (BF, AllocatorId, RegsToTrack);
0 commit comments