aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-08-07 00:26:35 +0000
committerBill Wendling <isanbard@gmail.com>2012-08-07 00:26:35 +0000
commit121418e55191904b01eb9ec182ef62af5f38e861 (patch)
tree37e9ff4d5d0b9d815624ffc31118c03215355b73 /include
parentc42a7017864fc62bfff36c1b8b7f4cd68e198861 (diff)
downloadexternal_llvm-121418e55191904b01eb9ec182ef62af5f38e861.zip
external_llvm-121418e55191904b01eb9ec182ef62af5f38e861.tar.gz
external_llvm-121418e55191904b01eb9ec182ef62af5f38e861.tar.bz2
Constify the Type parameter to some methods (which are const anyway).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetData.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 4f94ab7..1538d30 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -100,9 +100,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, Type *Ty) const;
+ bool ABIAlign, const Type *Ty) const;
//! Internal helper method that returns requested alignment for type.
- unsigned getAlignment(Type *Ty, bool abi_or_pref) const;
+ unsigned getAlignment(const Type *Ty, bool abi_or_pref) const;
/// Valid alignment predicate.
///
@@ -223,19 +223,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(Type* Ty) const;
+ uint64_t getTypeSizeInBits(const 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(Type *Ty) const {
+ uint64_t getTypeStoreSize(const 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(Type *Ty) const {
+ uint64_t getTypeStoreSizeInBits(const Type *Ty) const {
return 8*getTypeStoreSize(Ty);
}
@@ -243,7 +243,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(Type* Ty) const {
+ uint64_t getTypeAllocSize(const Type* Ty) const {
// Round up to the next alignment boundary.
return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty));
}
@@ -252,13 +252,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(Type* Ty) const {
+ uint64_t getTypeAllocSizeInBits(const Type* Ty) const {
return 8*getTypeAllocSize(Ty);
}
/// getABITypeAlignment - Return the minimum ABI-required alignment for the
/// specified type.
- unsigned getABITypeAlignment(Type *Ty) const;
+ unsigned getABITypeAlignment(const Type *Ty) const;
/// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for
/// an integer type of the specified bitwidth.
@@ -267,17 +267,17 @@ public:
/// getCallFrameTypeAlignment - Return the minimum ABI-required alignment
/// for the specified type when it is part of a call frame.
- unsigned getCallFrameTypeAlignment(Type *Ty) const;
+ unsigned getCallFrameTypeAlignment(const 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(Type *Ty) const;
+ unsigned getPrefTypeAlignment(const Type *Ty) const;
/// getPreferredTypeAlignmentShift - Return the preferred alignment for the
/// specified type, returned as log2 of the value (a shift amount).
///
- unsigned getPreferredTypeAlignmentShift(Type *Ty) const;
+ unsigned getPreferredTypeAlignmentShift(const Type *Ty) const;
/// getIntPtrType - Return an unsigned integer type that is the same size or
/// greater to the host pointer size.
@@ -292,7 +292,7 @@ public:
/// 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(StructType *Ty) const;
+ const StructLayout *getStructLayout(const StructType *Ty) const;
/// getPreferredAlignment - Return the preferred alignment of the specified
/// global. This includes an explicitly requested alignment (if the global
@@ -355,7 +355,7 @@ public:
private:
friend class TargetData; // Only TargetData can create this class
- StructLayout(StructType *ST, const TargetData &TD);
+ StructLayout(const StructType *ST, const TargetData &TD);
};
} // End llvm namespace