aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-19 22:35:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-19 22:35:00 +0000
commitf734ea21a37e27862ccf7570c2c64ad904568234 (patch)
treebecfedf87d66222b56544dce2d2bbd21e0f8a34b /include
parent85f00083f54468afa796dfd003bf4cd45affd3f7 (diff)
downloadexternal_llvm-f734ea21a37e27862ccf7570c2c64ad904568234.zip
external_llvm-f734ea21a37e27862ccf7570c2c64ad904568234.tar.gz
external_llvm-f734ea21a37e27862ccf7570c2c64ad904568234.tar.bz2
Implement support for non-standard integer bit widths of any size. The
rules alignment is to pick the alignment that corresponds to the smallest specified alignment that is larger than the bit width of the type or the largest specified integer alignment if none are larger than the bitwidth of the type. For the byte size, the size returned is the next larger multiple of the alignment for that type (using the above rule). This patch also changes bit widths from "short" to "uint32_t" to ensure there are enough bits to specify any bit width that LLVM can handle (currently 2^23); 16-bits isn't enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetData.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 34cd897..36caf56 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -51,11 +51,11 @@ struct TargetAlignElem {
AlignTypeEnum AlignType : 8; //< Alignment type (AlignTypeEnum)
unsigned char ABIAlign; //< ABI alignment for this type/bitw
unsigned char PrefAlign; //< Pref. alignment for this type/bitw
- short TypeBitWidth; //< Type bit width
+ uint32_t TypeBitWidth; //< Type bit width
/// Initializer
static TargetAlignElem get(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, short bit_width);
+ unsigned char pref_align, uint32_t bit_width);
/// Equality predicate
bool operator==(const TargetAlignElem &rhs) const;
/// output stream operator
@@ -89,8 +89,8 @@ private:
//! Set/initialize target alignments
void setAlignment(AlignTypeEnum align_type, unsigned char abi_align,
- unsigned char pref_align, short bit_width);
- unsigned getAlignmentInfo(AlignTypeEnum align_type, short bit_width,
+ unsigned char pref_align, uint32_t bit_width);
+ unsigned getAlignmentInfo(AlignTypeEnum align_type, uint32_t bit_width,
bool ABIAlign) const;
//! Internal helper method that returns requested alignment for type.
unsigned char getAlignment(const Type *Ty, bool abi_or_pref) const;
@@ -161,11 +161,11 @@ public:
/// specified type.
uint64_t getTypeSizeInBits(const Type* Ty) const;
- /// getTypeAlignmentABI - Return the minimum ABI-required alignment for the
+ /// getABITypeAlignment - Return the minimum ABI-required alignment for the
/// specified type.
unsigned char getABITypeAlignment(const Type *Ty) const;
- /// getTypeAlignmentPref - Return the preferred stack/global alignment for
+ /// getPrefTypeAlignment - Return the preferred stack/global alignment for
/// the specified type.
unsigned char getPrefTypeAlignment(const Type *Ty) const;