InlineOrder.h 1.2 KB

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