LLVM  3.7.0
UseListOrder.h
Go to the documentation of this file.
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 "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/SmallVector.h"
20 #include <vector>
21 
22 namespace llvm {
23 
24 class Module;
25 class Function;
26 class Value;
27 
28 /// \brief Structure to hold a use-list order.
29 struct UseListOrder {
30  const Value *V;
31  const Function *F;
32  std::vector<unsigned> Shuffle;
33 
34  UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
35  : V(V), F(F), Shuffle(ShuffleSize) {}
36 
37  UseListOrder() : V(0), F(0) {}
39  : V(X.V), F(X.F), Shuffle(std::move(X.Shuffle)) {}
41  V = X.V;
42  F = X.F;
43  Shuffle = std::move(X.Shuffle);
44  return *this;
45  }
46 
47 private:
48  UseListOrder(const UseListOrder &X) = delete;
49  UseListOrder &operator=(const UseListOrder &X) = delete;
50 };
51 
52 typedef std::vector<UseListOrder> UseListOrderStack;
53 
54 } // end namespace llvm
55 
56 #endif
std::vector< unsigned > Shuffle
Definition: UseListOrder.h:32
const Value * V
Definition: UseListOrder.h:30
UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
Definition: UseListOrder.h:34
std::vector< UseListOrder > UseListOrderStack
Definition: UseListOrder.h:52
Structure to hold a use-list order.
Definition: UseListOrder.h:29
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
const Function * F
Definition: UseListOrder.h:31
UseListOrder(UseListOrder &&X)
Definition: UseListOrder.h:38
UseListOrder & operator=(UseListOrder &&X)
Definition: UseListOrder.h:40
LLVM Value Representation.
Definition: Value.h:69