diff options
author | Eric Christopher <echristo@gmail.com> | 2015-09-16 23:38:13 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-09-16 23:38:13 +0000 |
commit | a4e5d3cf8ecba1d2fa03ec590424a4a5e535e5d1 (patch) | |
tree | 363c80342cc75734ea02bbc030a7377d0ca39937 /llvm/lib/Analysis | |
parent | 88be1ac06224e2a33569534f2eebcfb891016b9e (diff) | |
download | bcm5719-llvm-a4e5d3cf8ecba1d2fa03ec590424a4a5e535e5d1.tar.gz bcm5719-llvm-a4e5d3cf8ecba1d2fa03ec590424a4a5e535e5d1.zip |
constify the Function parameter to the TTI creation callback and
propagate to all callers/users/etc.
llvm-svn: 247864
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/TargetTransformInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index f2984ef1ae2..75e940c74dd 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -344,16 +344,16 @@ TargetTransformInfo::Concept::~Concept() {} TargetIRAnalysis::TargetIRAnalysis() : TTICallback(&getDefaultTTI) {} TargetIRAnalysis::TargetIRAnalysis( - std::function<Result(Function &)> TTICallback) + std::function<Result(const Function &)> TTICallback) : TTICallback(TTICallback) {} -TargetIRAnalysis::Result TargetIRAnalysis::run(Function &F) { +TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F) { return TTICallback(F); } char TargetIRAnalysis::PassID; -TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(Function &F) { +TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(const Function &F) { return Result(F.getParent()->getDataLayout()); } @@ -377,7 +377,7 @@ TargetTransformInfoWrapperPass::TargetTransformInfoWrapperPass( *PassRegistry::getPassRegistry()); } -TargetTransformInfo &TargetTransformInfoWrapperPass::getTTI(Function &F) { +TargetTransformInfo &TargetTransformInfoWrapperPass::getTTI(const Function &F) { TTI = TIRA.run(F); return *TTI; } |