Skip to content

Commit 99779b4

Browse files
[SCCPSolver] Mark several functions const (NFC) (#140926)
1 parent fd8bc37 commit 99779b4

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

llvm/include/llvm/Transforms/Utils/SCCPSolver.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ class SCCPSolver {
143143

144144
/// getTrackedGlobals - Get and return the set of inferred initializers for
145145
/// global variables.
146-
const DenseMap<GlobalVariable *, ValueLatticeElement> &getTrackedGlobals();
146+
const DenseMap<GlobalVariable *, ValueLatticeElement> &
147+
getTrackedGlobals() const;
147148

148149
/// getMRVFunctionsTracked - Get the set of functions which return multiple
149150
/// values tracked by the pass.
150-
const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked();
151+
const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() const;
151152

152153
/// markOverdefined - Mark the specified value overdefined. This
153154
/// works with both scalars and structs.

llvm/lib/Transforms/Utils/SCCPSolver.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -839,15 +839,16 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
839839
return I->second;
840840
}
841841

842-
const MapVector<Function *, ValueLatticeElement> &getTrackedRetVals() {
842+
const MapVector<Function *, ValueLatticeElement> &getTrackedRetVals() const {
843843
return TrackedRetVals;
844844
}
845845

846-
const DenseMap<GlobalVariable *, ValueLatticeElement> &getTrackedGlobals() {
846+
const DenseMap<GlobalVariable *, ValueLatticeElement> &
847+
getTrackedGlobals() const {
847848
return TrackedGlobals;
848849
}
849850

850-
const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() {
851+
const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() const {
851852
return MRVFunctionsTracked;
852853
}
853854

@@ -2226,11 +2227,11 @@ SCCPSolver::getTrackedRetVals() const {
22262227
}
22272228

22282229
const DenseMap<GlobalVariable *, ValueLatticeElement> &
2229-
SCCPSolver::getTrackedGlobals() {
2230+
SCCPSolver::getTrackedGlobals() const {
22302231
return Visitor->getTrackedGlobals();
22312232
}
22322233

2233-
const SmallPtrSet<Function *, 16> &SCCPSolver::getMRVFunctionsTracked() {
2234+
const SmallPtrSet<Function *, 16> &SCCPSolver::getMRVFunctionsTracked() const {
22342235
return Visitor->getMRVFunctionsTracked();
22352236
}
22362237

0 commit comments

Comments
 (0)