UseListOrder.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/IR/UseListOrder.h - LLVM Use List Order -------------*- 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. // This file has structures and command-line options for preserving use-list
  15. // order.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_IR_USELISTORDER_H
  19. #define LLVM_IR_USELISTORDER_H
  20. #include <cstddef>
  21. #include <vector>
  22. namespace llvm {
  23. class Function;
  24. class Value;
  25. /// Structure to hold a use-list order.
  26. struct UseListOrder {
  27. const Value *V = nullptr;
  28. const Function *F = nullptr;
  29. std::vector<unsigned> Shuffle;
  30. UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
  31. : V(V), F(F), Shuffle(ShuffleSize) {}
  32. UseListOrder() = default;
  33. UseListOrder(UseListOrder &&) = default;
  34. UseListOrder &operator=(UseListOrder &&) = default;
  35. };
  36. using UseListOrderStack = std::vector<UseListOrder>;
  37. } // end namespace llvm
  38. #endif // LLVM_IR_USELISTORDER_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif