2014-08-01 23:03:36 +00:00
|
|
|
//===- llvm/IR/UseListOrder.h - LLVM Use List Order -------------*- C++ -*-===//
|
2014-07-25 14:49:26 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2014-08-01 23:03:36 +00:00
|
|
|
// This file has structures and command-line options for preserving use-list
|
|
|
|
// order.
|
2014-07-25 14:49:26 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_IR_USELISTORDER_H
|
|
|
|
#define LLVM_IR_USELISTORDER_H
|
|
|
|
|
2014-07-25 15:41:49 +00:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2014-07-28 21:19:41 +00:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
#include <vector>
|
2014-07-25 15:41:49 +00:00
|
|
|
|
2014-07-25 14:49:26 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
2014-07-28 21:19:41 +00:00
|
|
|
class Function;
|
|
|
|
class Value;
|
|
|
|
|
|
|
|
/// \brief Structure to hold a use-list order.
|
|
|
|
struct UseListOrder {
|
|
|
|
const Value *V;
|
2014-07-28 22:41:50 +00:00
|
|
|
const Function *F;
|
2014-08-06 17:36:08 +00:00
|
|
|
std::vector<unsigned> Shuffle;
|
2014-07-28 22:41:50 +00:00
|
|
|
|
|
|
|
UseListOrder(const Value *V, const Function *F, size_t ShuffleSize)
|
|
|
|
: V(V), F(F), Shuffle(ShuffleSize) {}
|
2014-07-29 21:30:21 +00:00
|
|
|
|
|
|
|
UseListOrder() : V(0), F(0) {}
|
|
|
|
UseListOrder(UseListOrder &&X)
|
|
|
|
: V(X.V), F(X.F), Shuffle(std::move(X.Shuffle)) {}
|
2014-07-30 00:25:33 +00:00
|
|
|
UseListOrder &operator=(UseListOrder &&X) {
|
|
|
|
V = X.V;
|
|
|
|
F = X.F;
|
|
|
|
Shuffle = std::move(X.Shuffle);
|
|
|
|
return *this;
|
|
|
|
}
|
2014-07-29 21:30:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
UseListOrder(const UseListOrder &X) LLVM_DELETED_FUNCTION;
|
|
|
|
UseListOrder &operator=(const UseListOrder &X) LLVM_DELETED_FUNCTION;
|
2014-07-28 21:19:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<UseListOrder> UseListOrderStack;
|
2014-07-25 14:49:26 +00:00
|
|
|
|
|
|
|
/// \brief Whether to preserve use-list ordering.
|
|
|
|
bool shouldPreserveBitcodeUseListOrder();
|
2014-07-25 15:41:49 +00:00
|
|
|
bool shouldPreserveAssemblyUseListOrder();
|
2014-08-19 21:08:27 +00:00
|
|
|
void setPreserveBitcodeUseListOrder(bool ShouldPreserve);
|
|
|
|
void setPreserveAssemblyUseListOrder(bool ShouldPreserve);
|
2014-07-25 14:49:26 +00:00
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|