Constify the Optnone checks in IR passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202213 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Paul Robinson
2014-02-26 01:23:26 +00:00
parent 204755b283
commit cf84b5ba5e
4 changed files with 8 additions and 8 deletions

View File

@ -85,7 +85,7 @@ public:
protected: protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone /// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
/// and most transformation passes should skip it. /// and most transformation passes should skip it.
bool skipOptnoneFunction(Loop *L) const; bool skipOptnoneFunction(const Loop *L) const;
}; };
class LPPassManager : public FunctionPass, public PMDataManager { class LPPassManager : public FunctionPass, public PMDataManager {

View File

@ -311,7 +311,7 @@ public:
protected: protected:
/// skipOptnoneFunction - This function has Attribute::OptimizeNone /// skipOptnoneFunction - This function has Attribute::OptimizeNone
/// and most transformation passes should skip it. /// and most transformation passes should skip it.
bool skipOptnoneFunction(Function &F) const; bool skipOptnoneFunction(const Function &F) const;
}; };
@ -360,7 +360,7 @@ public:
protected: protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone /// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
/// and most transformation passes should skip it. /// 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 /// If the user specifies the -time-passes argument on an LLVM tool command line

View File

@ -368,8 +368,8 @@ void LoopPass::assignPassManager(PMStack &PMS,
// Containing function has Attribute::OptimizeNone and transformation // Containing function has Attribute::OptimizeNone and transformation
// passes should skip it. // passes should skip it.
bool LoopPass::skipOptnoneFunction(Loop *L) const { bool LoopPass::skipOptnoneFunction(const Loop *L) const {
Function *F = L->getHeader()->getParent(); const Function *F = L->getHeader()->getParent();
if (F && F->hasFnAttribute(Attribute::OptimizeNone)) { if (F && F->hasFnAttribute(Attribute::OptimizeNone)) {
// FIXME: Report this to dbgs() only once per function. // FIXME: Report this to dbgs() only once per function.
DEBUG(dbgs() << "Skipping pass '" << getPassName() DEBUG(dbgs() << "Skipping pass '" << getPassName()

View File

@ -138,7 +138,7 @@ PassManagerType FunctionPass::getPotentialPassManagerType() const {
return PMT_FunctionPassManager; return PMT_FunctionPassManager;
} }
bool FunctionPass::skipOptnoneFunction(Function &F) const { bool FunctionPass::skipOptnoneFunction(const Function &F) const {
if (F.hasFnAttribute(Attribute::OptimizeNone)) { if (F.hasFnAttribute(Attribute::OptimizeNone)) {
DEBUG(dbgs() << "Skipping pass '" << getPassName() DEBUG(dbgs() << "Skipping pass '" << getPassName()
<< "' on function " << F.getName() << "\n"); << "' on function " << F.getName() << "\n");
@ -166,8 +166,8 @@ bool BasicBlockPass::doFinalization(Function &) {
return false; return false;
} }
bool BasicBlockPass::skipOptnoneFunction(BasicBlock &BB) const { bool BasicBlockPass::skipOptnoneFunction(const BasicBlock &BB) const {
Function *F = BB.getParent(); const Function *F = BB.getParent();
if (F && F->hasFnAttribute(Attribute::OptimizeNone)) { if (F && F->hasFnAttribute(Attribute::OptimizeNone)) {
// Report this only once per function. // Report this only once per function.
if (&BB == &F->getEntryBlock()) if (&BB == &F->getEntryBlock())