diff options
| author | Evandro Menezes <e.menezes@samsung.com> | 2019-04-03 21:27:03 +0000 |
|---|---|---|
| committer | Evandro Menezes <e.menezes@samsung.com> | 2019-04-03 21:27:03 +0000 |
| commit | 7c711ccf36e0a818f76d711715956ffe831f53b6 (patch) | |
| tree | cfbd36f2d353a8c2eed5a47196fb39821ac5ec1f /llvm/lib/IR | |
| parent | 4d50879d9c93cdadfd6b0918931907c821d06520 (diff) | |
| download | bcm5719-llvm-7c711ccf36e0a818f76d711715956ffe831f53b6.tar.gz bcm5719-llvm-7c711ccf36e0a818f76d711715956ffe831f53b6.zip | |
[IR] Create new method in `Function` class (NFC)
Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.
Differential revision: https://reviews.llvm.org/D59852
llvm-svn: 357638
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/Pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Pass.cpp b/llvm/lib/IR/Pass.cpp index 4038205e044..f7815584fc4 100644 --- a/llvm/lib/IR/Pass.cpp +++ b/llvm/lib/IR/Pass.cpp @@ -168,7 +168,7 @@ bool FunctionPass::skipFunction(const Function &F) const { if (Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(F))) return true; - if (F.hasFnAttribute(Attribute::OptimizeNone)) { + if (F.optForNone()) { LLVM_DEBUG(dbgs() << "Skipping pass '" << getPassName() << "' on function " << F.getName() << "\n"); return true; @@ -207,7 +207,7 @@ bool BasicBlockPass::skipBasicBlock(const BasicBlock &BB) const { OptPassGate &Gate = F->getContext().getOptPassGate(); if (Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(BB))) return true; - if (F->hasFnAttribute(Attribute::OptimizeNone)) { + if (F->optForNone()) { // Report this only once per function. if (&BB == &F->getEntryBlock()) LLVM_DEBUG(dbgs() << "Skipping pass '" << getPassName() |

