1 //===- llvm/IR/UseListOrder.h - LLVM Use List Order functions ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file has functions to modify the use-list order and to verify that it
11 // doesn't change after serialization.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_IR_USELISTORDER_H
16 #define LLVM_IR_USELISTORDER_H
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/SmallVector.h"
28 /// \brief Structure to hold a use-list order.
32 SmallVector<unsigned, 8> Shuffle;
35 typedef std::vector<UseListOrder> UseListOrderStack;
37 /// \brief Whether to preserve use-list ordering.
38 bool shouldPreserveBitcodeUseListOrder();
39 bool shouldPreserveAssemblyUseListOrder();
41 /// \brief Shuffle all use-lists in a module.
43 /// Adds \c SeedOffset to the default seed for the random number generator.
44 void shuffleUseLists(Module &M, unsigned SeedOffset = 0);
46 } // end namespace llvm