X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FConstants.h;h=23e548ae30bab091c944164e3fd811a194eba3a5;hb=553c42cefc9abe1f10ee33d34a12498b8ac12fe6;hp=b7d1a488f5294d4496b64e5d389a1a1d1d689f02;hpb=4d7f70cbb5611bb9f840377ddb65ca78f3afa8e2;p=oota-llvm.git diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index b7d1a488f52..23e548ae30b 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -21,11 +21,11 @@ #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 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);