[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h

Reid Spencer reid at x10sys.com
Mon Feb 19 14:35:23 PST 2007



Changes in directory llvm/include/llvm/Target:

TargetData.h updated: 1.57 -> 1.58
---
Log message:

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.


---
Diffs of the changes:  (+6 -6)

 TargetData.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.57 llvm/include/llvm/Target/TargetData.h:1.58
--- llvm/include/llvm/Target/TargetData.h:1.57	Fri Feb 16 18:41:42 2007
+++ llvm/include/llvm/Target/TargetData.h	Mon Feb 19 16:35:00 2007
@@ -51,11 +51,11 @@
   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 @@
 
   //! 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 @@
   /// 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;
 






More information about the llvm-commits mailing list