• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/llvmCore-3425.0.34/include/llvm/

Lines Matching refs:Constant

1 //===-- llvm/Constants.h - Constant class subclass definitions --*- C++ -*-===//
11 /// This file contains the declarations for the subclasses of Constant,
15 /// equivalent constants will always have the same address. Constant's are
24 #include "llvm/Constant.h"
50 class ConstantInt : public Constant {
64 static Constant *getTrue(Type *Ty);
65 static Constant *getFalse(Type *Ty);
67 /// If Ty is a vector type, return a Constant with a splat of the given
69 static Constant *get(Type *Ty, uint64_t V, bool isSigned = false);
86 static Constant *getSigned(Type *Ty, int64_t V);
97 /// If Ty is a vector type, return a Constant with a splat of the given
99 static Constant *get(Type* Ty, const APInt& V);
234 class ConstantFP : public Constant {
251 static Constant *getZeroValueForNegation(Type *Ty);
257 static Constant *get(Type* Ty, double V);
258 static Constant *get(Type* Ty, StringRef Str);
303 class ConstantAggregateZero : public Constant {
308 : Constant(ty, ConstantAggregateZeroVal, 0, 0) {}
321 Constant *getSequentialElement() const;
325 Constant *getStructElement(unsigned Elt) const;
329 Constant *getElementValue(Constant *C) const;
333 Constant *getElementValue(unsigned Idx) const;
345 /// ConstantArray - Constant Array Declarations
347 class ConstantArray : public Constant {
351 ConstantArray(ArrayType *T, ArrayRef<Constant *> Val);
354 static Constant *get(ArrayType *T, ArrayRef<Constant*> V);
357 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
381 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantArray, Constant)
384 // ConstantStruct - Constant Struct Declarations
386 class ConstantStruct : public Constant {
390 ConstantStruct(StructType *T, ArrayRef<Constant *> Val);
393 static Constant *get(StructType *T, ArrayRef<Constant*> V);
394 static Constant *get(StructType *T, ...) END_WITH_NULL;
399 static Constant *getAnon(ArrayRef<Constant*> V, bool Packed = false) {
402 static Constant *getAnon(LLVMContext &Ctx,
403 ArrayRef<Constant*> V, bool Packed = false) {
409 static StructType *getTypeForElements(ArrayRef<Constant*> V,
413 ArrayRef<Constant*> V,
417 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
440 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantStruct, Constant)
444 /// ConstantVector - Constant Vector Declarations
446 class ConstantVector : public Constant {
450 ConstantVector(VectorType *T, ArrayRef<Constant *> Val);
453 static Constant *get(ArrayRef<Constant*> V);
457 static Constant *getSplat(unsigned NumElts, Constant *Elt);
460 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
471 Constant *getSplatValue() const;
488 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantVector, Constant)
493 class ConstantPointerNull : public Constant {
498 : Constant(reinterpret_cast<Type*>(T),
529 /// simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no
535 class ConstantDataSequential : public Constant {
550 : Constant(ty, VT, 0, 0), DataElements(Data), Next(0) {}
553 static Constant *getImpl(StringRef Bytes, Type *Ty);
584 /// getElementAsConstant - Return a Constant for a specified index's element.
587 Constant *getElementAsConstant(unsigned i) const;
654 /// data values (i.e. ConstantInt/ConstantFP). This Constant node has no
674 static Constant *get(LLVMContext &Context, ArrayRef<uint8_t> Elts);
675 static Constant *get(LLVMContext &Context, ArrayRef<uint16_t> Elts);
676 static Constant *get(LLVMContext &Context, ArrayRef<uint32_t> Elts);
677 static Constant *get(LLVMContext &Context, ArrayRef<uint64_t> Elts);
678 static Constant *get(LLVMContext &Context, ArrayRef<float> Elts);
679 static Constant *get(LLVMContext &Context, ArrayRef<double> Elts);
686 static Constant *getString(LLVMContext &Context, StringRef Initializer,
707 /// data values (i.e. ConstantInt/ConstantFP). This Constant node has no
727 static Constant *get(LLVMContext &Context, ArrayRef<uint8_t> Elts);
728 static Constant *get(LLVMContext &Context, ArrayRef<uint16_t> Elts);
729 static Constant *get(LLVMContext &Context, ArrayRef<uint32_t> Elts);
730 static Constant *get(LLVMContext &Context, ArrayRef<uint64_t> Elts);
731 static Constant *get(LLVMContext &Context, ArrayRef<float> Elts);
732 static Constant *get(LLVMContext &Context, ArrayRef<double> Elts);
737 static Constant *getSplat(unsigned NumElts, Constant *Elt);
741 Constant *getSplatValue() const;
762 class BlockAddress : public Constant {
805 class ConstantExpr : public Constant {
807 std::pair<unsigned, std::vector<Constant*> > >;
812 : Constant(ty, ConstantExprVal, Ops, NumOps) {
825 static Constant *getAlignOf(Type *Ty);
831 static Constant *getSizeOf(Type *Ty);
836 static Constant *getOffsetOf(StructType *STy, unsigned FieldNo);
839 /// which supports any aggregate type, and any Constant index.
841 static Constant *getOffsetOf(Type *Ty, Constant *FieldNo);
843 static Constant *getNeg(Constant *C, bool HasNUW = false, bool HasNSW =false);
844 static Constant *getFNeg(Constant *C);
845 static Constant *getNot(Constant *C);
846 static Constant *getAdd(Constant *C1, Constant *C2,
848 static Constant *getFAdd(Constant *C1, Constant *C2);
849 static Constant *getSub(Constant *C1, Constant *C2,
851 static Constant *getFSub(Constant *C1, Constant *C2);
852 static Constant *getMul(Constant *C1, Constant *C2,
854 static Constant *getFMul(Constant *C1, Constant *C2);
855 static Constant *getUDiv(Constant *C1, Constant *C2, bool isExact = false);
856 static Constant *getSDiv(Constant *C1, Constant *C2, bool isExact = false);
857 static Constant *getFDiv(Constant *C1, Constant *C2);
858 static Constant *getURem(Constant *C1, Constant *C2);
859 static Constant *getSRem(Constant *C1, Constant *C2);
860 static Constant *getFRem(Constant *C1, Constant *C2);
861 static Constant *getAnd(Constant *C1, Constant *C2);
862 static Constant *getOr(Constant *C1, Constant *C2);
863 static Constant *getXor(Constant *C1, Constant *C2);
864 static Constant *getShl(Constant *C1, Constant *C2,
866 static Constant *getLShr(Constant *C1, Constant *C2, bool isExact = false);
867 static Constant *getAShr(Constant *C1, Constant *C2, bool isExact = false);
868 static Constant *getTrunc (Constant *C, Type *Ty);
869 static Constant *getSExt (Constant *C, Type *Ty);
870 static Constant *getZExt (Constant *C, Type *Ty);
871 static Constant *getFPTrunc (Constant *C, Type *Ty);
872 static Constant *getFPExtend(Constant *C, Type *Ty);
873 static Constant *getUIToFP (Constant *C, Type *Ty);
874 static Constant *getSIToFP (Constant *C, Type *Ty);
875 static Constant *getFPToUI (Constant *C, Type *Ty);
876 static Constant *getFPToSI (Constant *C, Type *Ty);
877 static Constant *getPtrToInt(Constant *C, Type *Ty);
878 static Constant *getIntToPtr(Constant *C, Type *Ty);
879 static Constant *getBitCast (Constant *C, Type *Ty);
881 static Constant *getNSWNeg(Constant *C) { return getNeg(C, false, true); }
882 static Constant *getNUWNeg(Constant *C) { return getNeg(C, true, false); }
883 static Constant *getNSWAdd(Constant *C1, Constant *C2) {
886 static Constant *getNUWAdd(Constant *C1, Constant *C2) {
889 static Constant *getNSWSub(Constant *C1, Constant *C2) {
892 static Constant *getNUWSub(Constant *C1, Constant *C2) {
895 static Constant *getNSWMul(Constant *C1, Constant *C2) {
898 static Constant *getNUWMul(Constant *C1, Constant *C2) {
901 static Constant *getNSWShl(Constant *C1, Constant *C2) {
904 static Constant *getNUWShl(Constant *C1, Constant *C2) {
907 static Constant *getExactSDiv(Constant *C1, Constant *C2) {
910 static Constant *getExactUDiv(Constant *C1, Constant *C2) {
913 static Constant *getExactAShr(Constant *C1, Constant *C2) {
916 static Constant *getExactLShr(Constant *C1, Constant *C2) {
923 static Constant *getBinOpIdentity(unsigned Opcode, Type *Ty);
929 static Constant *getBinOpAbsorber(unsigned Opcode, Type *Ty);
932 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
936 static Constant *getCast(
938 Constant *C, ///< The constant to be converted
943 static Constant *getZExtOrBitCast(
944 Constant *C, ///< The constant to zext or bitcast
949 static Constant *getSExtOrBitCast(
950 Constant *C, ///< The constant to sext or bitcast
955 static Constant *getTruncOrBitCast(
956 Constant *C, ///< The constant to trunc or bitcast
961 static Constant *getPointerCast(
962 Constant *C, ///< The pointer value to be casted (operand 0)
967 static Constant *getIntegerCast(
968 Constant *C, ///< The integer constant to be casted
974 static Constant *getFPCast(
975 Constant *C, ///< The integer constant to be casted
998 static Constant *getSelect(Constant *C, Constant *V1, Constant *V2);
1003 static Constant *get(unsigned Opcode, Constant *C1, Constant *C2,
1007 static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2);
1012 static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS);
1013 static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS);
1016 /// all elements must be Constant's.
1018 static Constant *getGetElementPtr(Constant *C,
1019 ArrayRef<Constant *> IdxList,
1025 static Constant *getGetElementPtr(Constant *C,
1026 Constant *Idx,
1029 // warnings about whether to convert Idx to ArrayRef<Constant *> or
1033 static Constant *getGetElementPtr(Constant *C,
1039 static Constant *getInBoundsGetElementPtr(Constant *C,
1040 ArrayRef<Constant *> IdxList) {
1043 static Constant *getInBoundsGetElementPtr(Constant *C,
1044 Constant *Idx) {
1046 // warnings about whether to convert Idx to ArrayRef<Constant *> or
1050 static Constant *getInBoundsGetElementPtr(Constant *C,
1055 static Constant *getExtractElement(Constant *Vec, Constant *Idx);
1056 static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);
1057 static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
1058 static Constant *getExtractValue(Constant *Agg, ArrayRef<unsigned> Idxs);
1059 static Constant *getInsertValue(Constant *Agg, Constant *Val,
1078 Constant *getWithOperandReplaced(unsigned OpNo, Constant *Op) const;
1083 Constant *getWithOperands(ArrayRef<Constant*> Ops) const {
1091 Constant *getWithOperands(ArrayRef<Constant*> Ops, Type *Ty) const;
1115 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantExpr, Constant)
1127 class UndefValue : public Constant {
1131 explicit UndefValue(Type *T) : Constant(T, UndefValueVal, 0, 0) {}
1153 UndefValue *getElementValue(Constant *C) const;