RegisterPresssureTracker: Track live physical register by unit.
[oota-llvm.git] / include / llvm / Constants.h
index b7d1a488f5294d4496b64e5d389a1a1d1d689f02..23e548ae30bab091c944164e3fd811a194eba3a5 100644 (file)
 #ifndef LLVM_CONSTANTS_H
 #define LLVM_CONSTANTS_H
 
-#include "llvm/Constant.h"
-#include "llvm/OperandTraits.h"
-#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Constant.h"
+#include "llvm/OperandTraits.h"
 
 namespace llvm {
 
@@ -1076,6 +1076,15 @@ public:
   /// current one.
   Constant *getWithOperands(ArrayRef<Constant*> Ops, Type *Ty) const;
 
+  /// getAsInstruction - Returns an Instruction which implements the same operation
+  /// as this ConstantExpr. The instruction is not linked to any basic block.
+  ///
+  /// A better approach to this could be to have a constructor for Instruction
+  /// which would take a ConstantExpr parameter, but that would have spread 
+  /// implementation details of ConstantExpr outside of Constants.cpp, which 
+  /// would make it harder to remove ConstantExprs altogether.
+  Instruction *getAsInstruction();
+
   virtual void destroyConstant();
   virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);