Home | History | Annotate | Download | only in IR
      1 //===- llvm/IR/UseListOrder.h - LLVM Use List Order -------------*- C++ -*-===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 // This file has structures and command-line options for preserving use-list
     11 // order.
     12 //
     13 //===----------------------------------------------------------------------===//
     14 
     15 #ifndef LLVM_IR_USELISTORDER_H
     16 #define LLVM_IR_USELISTORDER_H
     17 
     18 #include <cstddef>
     19 #include <vector>
     20 
     21 namespace llvm {
     22 
     23 class Function;
     24 class Value;
     25 
     26 /// \brief Structure to hold a use-list order.
     27 struct UseListOrder {
     28   const Value *V = nullptr;
     29   const Function *F = nullptr;
     30   std::vector<unsigned> Shuffle;
     31 
     32   UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
     33       : V(V), F(F), Shuffle(ShuffleSize) {}
     34 
     35   UseListOrder() = default;
     36   UseListOrder(UseListOrder &&) = default;
     37   UseListOrder &operator=(UseListOrder &&) = default;
     38 };
     39 
     40 using UseListOrderStack = std::vector<UseListOrder>;
     41 
     42 } // end namespace llvm
     43 
     44 #endif // LLVM_IR_USELISTORDER_H
     45