diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
commit | db125cfaf57cc83e7dd7453de2d509bc8efd0e5e (patch) | |
tree | a163ac0f83da7be3f9675a122a6144b12418be09 /include/llvm/Target | |
parent | 4b3d5469fb7c25504fa20dc65640f02d79675d48 (diff) | |
download | external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.zip external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.tar.gz external_llvm-db125cfaf57cc83e7dd7453de2d509bc8efd0e5e.tar.bz2 |
land David Blaikie's patch to de-constify Type, with a few tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetData.h | 28 | ||||
-rw-r--r-- | include/llvm/Target/TargetIntrinsicInfo.h | 4 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 16 |
3 files changed, 24 insertions, 24 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index c280810..e210b27 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -90,9 +90,9 @@ private: void setAlignment(AlignTypeEnum align_type, unsigned abi_align, unsigned pref_align, uint32_t bit_width); unsigned getAlignmentInfo(AlignTypeEnum align_type, uint32_t bit_width, - bool ABIAlign, const Type *Ty) const; + bool ABIAlign, Type *Ty) const; //! Internal helper method that returns requested alignment for type. - unsigned getAlignment(const Type *Ty, bool abi_or_pref) const; + unsigned getAlignment(Type *Ty, bool abi_or_pref) const; /// Valid alignment predicate. /// @@ -200,19 +200,19 @@ public: /// getTypeSizeInBits - Return the number of bits necessary to hold the /// specified type. For example, returns 36 for i36 and 80 for x86_fp80. - uint64_t getTypeSizeInBits(const Type* Ty) const; + uint64_t getTypeSizeInBits(Type* Ty) const; /// getTypeStoreSize - Return the maximum number of bytes that may be /// overwritten by storing the specified type. For example, returns 5 /// for i36 and 10 for x86_fp80. - uint64_t getTypeStoreSize(const Type *Ty) const { + uint64_t getTypeStoreSize(Type *Ty) const { return (getTypeSizeInBits(Ty)+7)/8; } /// getTypeStoreSizeInBits - Return the maximum number of bits that may be /// overwritten by storing the specified type; always a multiple of 8. For /// example, returns 40 for i36 and 80 for x86_fp80. - uint64_t getTypeStoreSizeInBits(const Type *Ty) const { + uint64_t getTypeStoreSizeInBits(Type *Ty) const { return 8*getTypeStoreSize(Ty); } @@ -220,7 +220,7 @@ public: /// of the specified type, including alignment padding. This is the amount /// that alloca reserves for this type. For example, returns 12 or 16 for /// x86_fp80, depending on alignment. - uint64_t getTypeAllocSize(const Type* Ty) const { + uint64_t getTypeAllocSize(Type* Ty) const { // Round up to the next alignment boundary. return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty)); } @@ -229,13 +229,13 @@ public: /// objects of the specified type, including alignment padding; always a /// multiple of 8. This is the amount that alloca reserves for this type. /// For example, returns 96 or 128 for x86_fp80, depending on alignment. - uint64_t getTypeAllocSizeInBits(const Type* Ty) const { + uint64_t getTypeAllocSizeInBits(Type* Ty) const { return 8*getTypeAllocSize(Ty); } /// getABITypeAlignment - Return the minimum ABI-required alignment for the /// specified type. - unsigned getABITypeAlignment(const Type *Ty) const; + unsigned getABITypeAlignment(Type *Ty) const; /// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for /// an integer type of the specified bitwidth. @@ -244,17 +244,17 @@ public: /// getCallFrameTypeAlignment - Return the minimum ABI-required alignment /// for the specified type when it is part of a call frame. - unsigned getCallFrameTypeAlignment(const Type *Ty) const; + unsigned getCallFrameTypeAlignment(Type *Ty) const; /// getPrefTypeAlignment - Return the preferred stack/global alignment for /// the specified type. This is always at least as good as the ABI alignment. - unsigned getPrefTypeAlignment(const Type *Ty) const; + unsigned getPrefTypeAlignment(Type *Ty) const; /// getPreferredTypeAlignmentShift - Return the preferred alignment for the /// specified type, returned as log2 of the value (a shift amount). /// - unsigned getPreferredTypeAlignmentShift(const Type *Ty) const; + unsigned getPreferredTypeAlignmentShift(Type *Ty) const; /// getIntPtrType - Return an unsigned integer type that is the same size or /// greater to the host pointer size. @@ -264,13 +264,13 @@ public: /// getIndexedOffset - return the offset from the beginning of the type for /// the specified indices. This is used to implement getelementptr. /// - uint64_t getIndexedOffset(const Type *Ty, + uint64_t getIndexedOffset(Type *Ty, Value* const* Indices, unsigned NumIndices) const; /// getStructLayout - Return a StructLayout object, indicating the alignment /// of the struct, its size, and the offsets of its fields. Note that this /// information is lazily cached. - const StructLayout *getStructLayout(const StructType *Ty) const; + const StructLayout *getStructLayout(StructType *Ty) const; /// getPreferredAlignment - Return the preferred alignment of the specified /// global. This includes an explicitly requested alignment (if the global @@ -333,7 +333,7 @@ public: private: friend class TargetData; // Only TargetData can create this class - StructLayout(const StructType *ST, const TargetData &TD); + StructLayout(StructType *ST, const TargetData &TD); }; } // End llvm namespace diff --git a/include/llvm/Target/TargetIntrinsicInfo.h b/include/llvm/Target/TargetIntrinsicInfo.h index ad8ac92..c44b923 100644 --- a/include/llvm/Target/TargetIntrinsicInfo.h +++ b/include/llvm/Target/TargetIntrinsicInfo.h @@ -39,7 +39,7 @@ public: /// intrinsic, Tys should point to an array of numTys pointers to Type, /// and must provide exactly one type for each overloaded type in the /// intrinsic. - virtual std::string getName(unsigned IID, const Type **Tys = 0, + virtual std::string getName(unsigned IID, Type **Tys = 0, unsigned numTys = 0) const = 0; /// Look up target intrinsic by name. Return intrinsic ID or 0 for unknown @@ -55,7 +55,7 @@ public: /// Create or insert an LLVM Function declaration for an intrinsic, /// and return it. The Tys and numTys are for intrinsics with overloaded /// types. See above for more information. - virtual Function *getDeclaration(Module *M, unsigned ID, const Type **Tys = 0, + virtual Function *getDeclaration(Module *M, unsigned ID, Type **Tys = 0, unsigned numTys = 0) const = 0; }; diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 533c3ac..8bb497e 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -501,7 +501,7 @@ public: /// This is fixed by the LLVM operations except for the pointer size. If /// AllowUnknown is true, this will return MVT::Other for types with no EVT /// counterpart (e.g. structs), otherwise it will assert. - EVT getValueType(const Type *Ty, bool AllowUnknown = false) const { + EVT getValueType(Type *Ty, bool AllowUnknown = false) const { EVT VT = EVT::getEVT(Ty, AllowUnknown); return VT == MVT::iPTR ? PointerTy : VT; } @@ -509,7 +509,7 @@ public: /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate /// function arguments in the caller parameter area. This is the actual /// alignment, not its logarithm. - virtual unsigned getByValTypeAlignment(const Type *Ty) const; + virtual unsigned getByValTypeAlignment(Type *Ty) const; /// getRegisterType - Return the type of registers that this ValueType will /// eventually require. @@ -1166,7 +1166,7 @@ public: /// lowering. struct ArgListEntry { SDValue Node; - const Type* Ty; + Type* Ty; bool isSExt : 1; bool isZExt : 1; bool isInReg : 1; @@ -1180,7 +1180,7 @@ public: }; typedef std::vector<ArgListEntry> ArgListTy; std::pair<SDValue, SDValue> - LowerCallTo(SDValue Chain, const Type *RetTy, bool RetSExt, bool RetZExt, + LowerCallTo(SDValue Chain, Type *RetTy, bool RetSExt, bool RetZExt, bool isVarArg, bool isInreg, unsigned NumFixedArgs, CallingConv::ID CallConv, bool isTailCall, bool isReturnValueUsed, SDValue Callee, ArgListTy &Args, @@ -1485,12 +1485,12 @@ public: /// The type may be VoidTy, in which case only return true if the addressing /// mode is legal for a load/store of any legal type. /// TODO: Handle pre/postinc as well. - virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const; + virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const; /// isTruncateFree - Return true if it's free to truncate a value of /// type Ty1 to type Ty2. e.g. On x86 it's free to truncate a i32 value in /// register EAX to i16 by referencing its sub-register AX. - virtual bool isTruncateFree(const Type *Ty1, const Type *Ty2) const { + virtual bool isTruncateFree(Type *Ty1, Type *Ty2) const { return false; } @@ -1506,7 +1506,7 @@ public: /// does not necessarily apply to truncate instructions. e.g. on x86-64, /// all instructions that define 32-bit values implicit zero-extend the /// result out to 64 bits. - virtual bool isZExtFree(const Type *Ty1, const Type *Ty2) const { + virtual bool isZExtFree(Type *Ty1, Type *Ty2) const { return false; } @@ -1963,7 +1963,7 @@ private: /// GetReturnInfo - Given an LLVM IR type and return type attributes, /// compute the return value EVTs and flags, and optionally also /// the offsets, if the return value is being lowered to memory. -void GetReturnInfo(const Type* ReturnType, Attributes attr, +void GetReturnInfo(Type* ReturnType, Attributes attr, SmallVectorImpl<ISD::OutputArg> &Outs, const TargetLowering &TLI, SmallVectorImpl<uint64_t> *Offsets = 0); |