Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line | 
|---|---|---|---|
| 14 | pmbaty | 1 | //===- InlineOrder.h - Inlining order abstraction -*- C++ ---*-------------===// | 
| 2 | // | ||
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| 4 | // See https://llvm.org/LICENSE.txt for license information. | ||
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| 6 | // | ||
| 7 | //===----------------------------------------------------------------------===// | ||
| 8 | // | ||
| 9 | #ifndef LLVM_ANALYSIS_INLINEORDER_H | ||
| 10 | #define LLVM_ANALYSIS_INLINEORDER_H | ||
| 11 | |||
| 12 | #include "llvm/ADT/STLFunctionalExtras.h" | ||
| 13 | #include "llvm/Analysis/InlineCost.h" | ||
| 14 | #include <utility> | ||
| 15 | |||
| 16 | namespace llvm { | ||
| 17 | class CallBase; | ||
| 18 | |||
| 19 | template <typename T> class InlineOrder { | ||
| 20 | public: | ||
| 21 | virtual ~InlineOrder() = default; | ||
| 22 | |||
| 23 | virtual size_t size() = 0; | ||
| 24 | |||
| 25 | virtual void push(const T &Elt) = 0; | ||
| 26 | |||
| 27 | virtual T pop() = 0; | ||
| 28 | |||
| 29 | virtual void erase_if(function_ref<bool(T)> Pred) = 0; | ||
| 30 | |||
| 31 | bool empty() { return !size(); } | ||
| 32 | }; | ||
| 33 | |||
| 34 | std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>> | ||
| 35 | getInlineOrder(FunctionAnalysisManager &FAM, const InlineParams &Params); | ||
| 36 | |||
| 37 | } // namespace llvm | ||
| 38 | #endif // LLVM_ANALYSIS_INLINEORDER_H |