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 Module; 24 class Function; 25 class Value; 26 27 /// \brief Structure to hold a use-list order. 28 struct UseListOrder { 29 const Value *V; 30 const Function *F; 31 std::vector<unsigned> Shuffle; 32 UseListOrderUseListOrder33 UseListOrder(const Value *V, const Function *F, size_t ShuffleSize) 34 : V(V), F(F), Shuffle(ShuffleSize) {} 35 UseListOrderUseListOrder36 UseListOrder() : V(nullptr), F(nullptr) {} UseListOrderUseListOrder37 UseListOrder(UseListOrder &&X) 38 : V(X.V), F(X.F), Shuffle(std::move(X.Shuffle)) {} 39 UseListOrder &operator=(UseListOrder &&X) { 40 V = X.V; 41 F = X.F; 42 Shuffle = std::move(X.Shuffle); 43 return *this; 44 } 45 46 private: 47 UseListOrder(const UseListOrder &X) = delete; 48 UseListOrder &operator=(const UseListOrder &X) = delete; 49 }; 50 51 typedef std::vector<UseListOrder> UseListOrderStack; 52 53 } // end namespace llvm 54 55 #endif // LLVM_IR_USELISTORDER_H 56