LLVM API Documentation

UseListOrder.h
Go to the documentation of this file.
00001 //===- llvm/IR/UseListOrder.h - LLVM Use List Order -------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file has structures and command-line options for preserving use-list
00011 // order.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_IR_USELISTORDER_H
00016 #define LLVM_IR_USELISTORDER_H
00017 
00018 #include "llvm/ADT/ArrayRef.h"
00019 #include "llvm/ADT/SmallVector.h"
00020 #include <vector>
00021 
00022 namespace llvm {
00023 
00024 class Module;
00025 class Function;
00026 class Value;
00027 
00028 /// \brief Structure to hold a use-list order.
00029 struct UseListOrder {
00030   const Value *V;
00031   const Function *F;
00032   std::vector<unsigned> Shuffle;
00033 
00034   UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
00035       : V(V), F(F), Shuffle(ShuffleSize) {}
00036 
00037   UseListOrder() : V(0), F(0) {}
00038   UseListOrder(UseListOrder &&X)
00039       : V(X.V), F(X.F), Shuffle(std::move(X.Shuffle)) {}
00040   UseListOrder &operator=(UseListOrder &&X) {
00041     V = X.V;
00042     F = X.F;
00043     Shuffle = std::move(X.Shuffle);
00044     return *this;
00045   }
00046 
00047 private:
00048   UseListOrder(const UseListOrder &X) LLVM_DELETED_FUNCTION;
00049   UseListOrder &operator=(const UseListOrder &X) LLVM_DELETED_FUNCTION;
00050 };
00051 
00052 typedef std::vector<UseListOrder> UseListOrderStack;
00053 
00054 /// \brief Whether to preserve use-list ordering.
00055 bool shouldPreserveBitcodeUseListOrder();
00056 bool shouldPreserveAssemblyUseListOrder();
00057 void setPreserveBitcodeUseListOrder(bool ShouldPreserve);
00058 void setPreserveAssemblyUseListOrder(bool ShouldPreserve);
00059 
00060 } // end namespace llvm
00061 
00062 #endif