Skip to content

Commit 75881d8

Browse files
committed
[NFC] const-ed the return type of FunctionPropertiesAnalysis
The result is a data bag, this makes sure it's signaled to a user that the data can't be mutated when, for example, doing something like: auto &R = FAM.getResult<FunctionPropertiesAnalysis>(F) ... R.Uses++
1 parent a546b9b commit 75881d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class FunctionPropertiesAnalysis
6666
public:
6767
static AnalysisKey Key;
6868

69-
using Result = FunctionPropertiesInfo;
69+
using Result = const FunctionPropertiesInfo;
7070

7171
Result run(Function &F, FunctionAnalysisManager &FAM);
7272
};

llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void FunctionPropertiesInfo::print(raw_ostream &OS) const {
7373

7474
AnalysisKey FunctionPropertiesAnalysis::Key;
7575

76-
FunctionPropertiesInfo
76+
const FunctionPropertiesInfo
7777
FunctionPropertiesAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
7878
return FunctionPropertiesInfo::getFunctionPropertiesInfo(
7979
F, FAM.getResult<LoopAnalysis>(F));

0 commit comments

Comments
 (0)