Skip to content

Commit a6d5e43

Browse files
committed
Drop redundant const qualifier from ArrayRef<T>
1 parent 32f9acc commit a6d5e43

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

bolt/include/bolt/Passes/PAuthGadgetScanner.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class LeakageInfo : public ExtraInfo {
264264
SmallVector<MCInstReference> LeakingInstrs;
265265

266266
public:
267-
LeakageInfo(const ArrayRef<MCInstReference> Instrs) : LeakingInstrs(Instrs) {}
267+
LeakageInfo(ArrayRef<MCInstReference> Instrs) : LeakingInstrs(Instrs) {}
268268

269269
void print(raw_ostream &OS, const MCInstReference Location) const override;
270270
};
@@ -311,7 +311,7 @@ class FunctionAnalysis {
311311
void augmentUnsafeUseReports(ArrayRef<BriefReport<MCPhysReg>> Reports);
312312

313313
void findUnsafeDefs(SmallVector<BriefReport<MCPhysReg>> &Reports);
314-
void augmentUnsafeDefReports(const ArrayRef<BriefReport<MCPhysReg>> Reports);
314+
void augmentUnsafeDefReports(ArrayRef<BriefReport<MCPhysReg>> Reports);
315315

316316
/// Process the reports which do not have to be augmented, and remove them
317317
/// from Reports.

bolt/lib/Passes/PAuthGadgetScanner.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -818,16 +818,15 @@ void DstStatePrinter::print(raw_ostream &OS, const DstState &S) const {
818818
/// version for functions without reconstructed CFG.
819819
class DstSafetyAnalysis {
820820
public:
821-
DstSafetyAnalysis(BinaryFunction &BF,
822-
const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
821+
DstSafetyAnalysis(BinaryFunction &BF, ArrayRef<MCPhysReg> RegsToTrackInstsFor)
823822
: BC(BF.getBinaryContext()), NumRegs(BC.MRI->getNumRegs()),
824823
RegsToTrackInstsFor(RegsToTrackInstsFor) {}
825824

826825
virtual ~DstSafetyAnalysis() {}
827826

828827
static std::shared_ptr<DstSafetyAnalysis>
829828
create(BinaryFunction &BF, MCPlusBuilder::AllocatorIdTy AllocId,
830-
const ArrayRef<MCPhysReg> RegsToTrackInstsFor);
829+
ArrayRef<MCPhysReg> RegsToTrackInstsFor);
831830

832831
virtual void run() = 0;
833832
virtual const DstState &getStateAfter(const MCInst &Inst) const = 0;
@@ -1030,7 +1029,7 @@ class DataflowDstSafetyAnalysis
10301029
public:
10311030
DataflowDstSafetyAnalysis(BinaryFunction &BF,
10321031
MCPlusBuilder::AllocatorIdTy AllocId,
1033-
const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1032+
ArrayRef<MCPhysReg> RegsToTrackInstsFor)
10341033
: DstSafetyAnalysis(BF, RegsToTrackInstsFor), DFParent(BF, AllocId) {}
10351034

10361035
const DstState &getStateAfter(const MCInst &Inst) const override {
@@ -1114,7 +1113,7 @@ class CFGUnawareDstSafetyAnalysis : public DstSafetyAnalysis {
11141113
public:
11151114
CFGUnawareDstSafetyAnalysis(BinaryFunction &BF,
11161115
MCPlusBuilder::AllocatorIdTy AllocId,
1117-
const ArrayRef<MCPhysReg> RegsToTrackInstsFor)
1116+
ArrayRef<MCPhysReg> RegsToTrackInstsFor)
11181117
: DstSafetyAnalysis(BF, RegsToTrackInstsFor), BF(BF), AllocId(AllocId) {
11191118
StateAnnotationIndex =
11201119
BC.MIB->getOrCreateAnnotationIndex("CFGUnawareDstSafetyAnalysis");
@@ -1157,7 +1156,7 @@ class CFGUnawareDstSafetyAnalysis : public DstSafetyAnalysis {
11571156
std::shared_ptr<DstSafetyAnalysis>
11581157
DstSafetyAnalysis::create(BinaryFunction &BF,
11591158
MCPlusBuilder::AllocatorIdTy AllocId,
1160-
const ArrayRef<MCPhysReg> RegsToTrackInstsFor) {
1159+
ArrayRef<MCPhysReg> RegsToTrackInstsFor) {
11611160
if (BF.hasCFG())
11621161
return std::make_shared<DataflowDstSafetyAnalysis>(BF, AllocId,
11631162
RegsToTrackInstsFor);
@@ -1391,7 +1390,7 @@ void FunctionAnalysis::findUnsafeDefs(
13911390
}
13921391

13931392
void FunctionAnalysis::augmentUnsafeDefReports(
1394-
const ArrayRef<BriefReport<MCPhysReg>> Reports) {
1393+
ArrayRef<BriefReport<MCPhysReg>> Reports) {
13951394
SmallVector<MCPhysReg> RegsToTrack = collectRegsToTrack(Reports);
13961395
// Re-compute the analysis with register tracking.
13971396
auto Analysis = DstSafetyAnalysis::create(BF, AllocatorId, RegsToTrack);

0 commit comments

Comments
 (0)