[llvm] r202213 - Constify the Optnone checks in IR passes.
Paul Robinson
paul_robinson at playstation.sony.com
Tue Feb 25 17:23:27 PST 2014
Author: probinson
Date: Tue Feb 25 19:23:26 2014
New Revision: 202213
URL: http://llvm.org/viewvc/llvm-project?rev=202213&view=rev
Log:
Constify the Optnone checks in IR passes.
Modified:
llvm/trunk/include/llvm/Analysis/LoopPass.h
llvm/trunk/include/llvm/Pass.h
llvm/trunk/lib/Analysis/LoopPass.cpp
llvm/trunk/lib/IR/Pass.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=202213&r1=202212&r2=202213&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopPass.h Tue Feb 25 19:23:26 2014
@@ -85,7 +85,7 @@ public:
protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
/// and most transformation passes should skip it.
- bool skipOptnoneFunction(Loop *L) const;
+ bool skipOptnoneFunction(const Loop *L) const;
};
class LPPassManager : public FunctionPass, public PMDataManager {
Modified: llvm/trunk/include/llvm/Pass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=202213&r1=202212&r2=202213&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Pass.h (original)
+++ llvm/trunk/include/llvm/Pass.h Tue Feb 25 19:23:26 2014
@@ -311,7 +311,7 @@ public:
protected:
/// skipOptnoneFunction - This function has Attribute::OptimizeNone
/// and most transformation passes should skip it.
- bool skipOptnoneFunction(Function &F) const;
+ bool skipOptnoneFunction(const Function &F) const;
};
@@ -360,7 +360,7 @@ public:
protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
/// and most transformation passes should skip it.
- bool skipOptnoneFunction(BasicBlock &BB) const;
+ bool skipOptnoneFunction(const BasicBlock &BB) const;
};
/// If the user specifies the -time-passes argument on an LLVM tool command line
Modified: llvm/trunk/lib/Analysis/LoopPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=202213&r1=202212&r2=202213&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopPass.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopPass.cpp Tue Feb 25 19:23:26 2014
@@ -368,8 +368,8 @@ void LoopPass::assignPassManager(PMStack
// Containing function has Attribute::OptimizeNone and transformation
// passes should skip it.
-bool LoopPass::skipOptnoneFunction(Loop *L) const {
- Function *F = L->getHeader()->getParent();
+bool LoopPass::skipOptnoneFunction(const Loop *L) const {
+ const Function *F = L->getHeader()->getParent();
if (F && F->hasFnAttribute(Attribute::OptimizeNone)) {
// FIXME: Report this to dbgs() only once per function.
DEBUG(dbgs() << "Skipping pass '" << getPassName()
Modified: llvm/trunk/lib/IR/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Pass.cpp?rev=202213&r1=202212&r2=202213&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Pass.cpp (original)
+++ llvm/trunk/lib/IR/Pass.cpp Tue Feb 25 19:23:26 2014
@@ -138,7 +138,7 @@ PassManagerType FunctionPass::getPotenti
return PMT_FunctionPassManager;
}
-bool FunctionPass::skipOptnoneFunction(Function &F) const {
+bool FunctionPass::skipOptnoneFunction(const Function &F) const {
if (F.hasFnAttribute(Attribute::OptimizeNone)) {
DEBUG(dbgs() << "Skipping pass '" << getPassName()
<< "' on function " << F.getName() << "\n");
@@ -166,8 +166,8 @@ bool BasicBlockPass::doFinalization(Func
return false;
}
-bool BasicBlockPass::skipOptnoneFunction(BasicBlock &BB) const {
- Function *F = BB.getParent();
+bool BasicBlockPass::skipOptnoneFunction(const BasicBlock &BB) const {
+ const Function *F = BB.getParent();
if (F && F->hasFnAttribute(Attribute::OptimizeNone)) {
// Report this only once per function.
if (&BB == &F->getEntryBlock())
More information about the llvm-commits
mailing list