[PATCH] D85793: [NFC] Factor out hasForceAttributes

Kyungwoo Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 15:34:06 PDT 2020


kyulee created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
kyulee requested review of this revision.

This is a preparation for https://reviews.llvm.org/D85586.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85793

Files:
  llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp


Index: llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
===================================================================
--- llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
+++ llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
@@ -88,9 +88,11 @@
   }
 }
 
+static bool hasForceAttributes() { return !ForceAttributes.empty(); }
+
 PreservedAnalyses ForceFunctionAttrsPass::run(Module &M,
                                               ModuleAnalysisManager &) {
-  if (ForceAttributes.empty())
+  if (!hasForceAttributes())
     return PreservedAnalyses::all();
 
   for (Function &F : M.functions())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85793.284919.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200811/cccd9e3c/attachment.bin>


More information about the llvm-commits mailing list