Skip to content

Commit 5a3776a

Browse files
[SCCPSolver] Make getMRVFunctionsTracked return a reference (NFC) (#140851)
This patch makes getMRVFunctionsTracked return a reference. runIPSCCP, the sole user of getMRVFunctionsTracked, just needs a read-access to the map. The missing "&" is most likely an oversight as two "sibling" functions getTrackedRetVals and getTrackedGlobals return maps by const reference.
1 parent d13947b commit 5a3776a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class SCCPSolver {
147147

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

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

llvm/lib/Transforms/Utils/SCCPSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
847847
return TrackedGlobals;
848848
}
849849

850-
const SmallPtrSet<Function *, 16> getMRVFunctionsTracked() {
850+
const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() {
851851
return MRVFunctionsTracked;
852852
}
853853

@@ -2230,7 +2230,7 @@ SCCPSolver::getTrackedGlobals() {
22302230
return Visitor->getTrackedGlobals();
22312231
}
22322232

2233-
const SmallPtrSet<Function *, 16> SCCPSolver::getMRVFunctionsTracked() {
2233+
const SmallPtrSet<Function *, 16> &SCCPSolver::getMRVFunctionsTracked() {
22342234
return Visitor->getMRVFunctionsTracked();
22352235
}
22362236

0 commit comments

Comments
 (0)