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

Misha Brukman brukman at cs.uiuc.edu
Thu Jul 22 18:08:23 PDT 2004



Changes in directory llvm/include/llvm/Target:

TargetData.h updated: 1.24 -> 1.25
TargetMachine.h updated: 1.48 -> 1.49

---
Log message:

* Add a BoolAlignment field to TargetData, default is 1 byte
* Fix spacing    


---
Diffs of the changes:  (+20 -16)

Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.24 llvm/include/llvm/Target/TargetData.h:1.25
--- llvm/include/llvm/Target/TargetData.h:1.24	Wed Apr 14 12:45:48 2004
+++ llvm/include/llvm/Target/TargetData.h	Thu Jul 22 20:08:13 2004
@@ -34,7 +34,8 @@
 
 class TargetData : public ImmutablePass {
   bool          LittleEndian;          // Defaults to false
-  unsigned char ByteAlignment;         // Defaults to 1 bytes
+  unsigned char BoolAlignment;         // Defaults to 1 byte
+  unsigned char ByteAlignment;         // Defaults to 1 byte
   unsigned char ShortAlignment;        // Defaults to 2 bytes
   unsigned char IntAlignment;          // Defaults to 4 bytes
   unsigned char LongAlignment;         // Defaults to 8 bytes
@@ -47,23 +48,24 @@
   TargetData(const std::string &TargetName = "",
              bool LittleEndian = false,
              unsigned char PtrSize = 8,
-	     unsigned char PtrAl = 8, unsigned char DoubleAl = 8,
-	     unsigned char FloatAl = 4, unsigned char LongAl = 8, 
-	     unsigned char IntAl = 4, unsigned char ShortAl = 2,
-	     unsigned char ByteAl = 1);
+             unsigned char PtrAl   = 8, unsigned char DoubleAl = 8,
+             unsigned char FloatAl = 4, unsigned char LongAl   = 8, 
+             unsigned char IntAl   = 4, unsigned char ShortAl  = 2,
+             unsigned char ByteAl  = 1, unsigned char BoolAl   = 1);
 
   // Copy constructor
   TargetData (const TargetData &TD) :
-    ImmutablePass (),
-    LittleEndian (TD.isLittleEndian ()),
-    ByteAlignment (TD.getByteAlignment ()),
-    ShortAlignment (TD.getShortAlignment ()),
-    IntAlignment (TD.getIntAlignment ()),
-    LongAlignment (TD.getLongAlignment ()),
-    FloatAlignment (TD.getFloatAlignment ()),
-    DoubleAlignment (TD.getDoubleAlignment ()),
-    PointerSize (TD.getPointerSize ()),
-    PointerAlignment (TD.getPointerAlignment ()) {
+    ImmutablePass(),
+    LittleEndian(TD.isLittleEndian()),
+    BoolAlignment(TD.getBoolAlignment()),
+    ByteAlignment(TD.getByteAlignment()),
+    ShortAlignment(TD.getShortAlignment()),
+    IntAlignment(TD.getIntAlignment()),
+    LongAlignment(TD.getLongAlignment()),
+    FloatAlignment(TD.getFloatAlignment()),
+    DoubleAlignment(TD.getDoubleAlignment()),
+    PointerSize(TD.getPointerSize()),
+    PointerAlignment(TD.getPointerAlignment()) {
   }
     
   TargetData(const std::string &ToolName, const Module *M);
@@ -74,6 +76,7 @@
   bool          isBigEndian()         const { return    !LittleEndian; }
 
   /// Target alignment constraints
+  unsigned char getBoolAlignment()    const { return    BoolAlignment; }
   unsigned char getByteAlignment()    const { return    ByteAlignment; }
   unsigned char getShortAlignment()   const { return   ShortAlignment; }
   unsigned char getIntAlignment()     const { return     IntAlignment; }


Index: llvm/include/llvm/Target/TargetMachine.h
diff -u llvm/include/llvm/Target/TargetMachine.h:1.48 llvm/include/llvm/Target/TargetMachine.h:1.49
--- llvm/include/llvm/Target/TargetMachine.h:1.48	Sat Jul 10 21:43:07 2004
+++ llvm/include/llvm/Target/TargetMachine.h	Thu Jul 22 20:08:13 2004
@@ -51,7 +51,8 @@
                 unsigned char PtrSize = 8, unsigned char PtrAl = 8,
                 unsigned char DoubleAl = 8, unsigned char FloatAl = 4,
                 unsigned char LongAl = 8, unsigned char IntAl = 4,
-                unsigned char ShortAl = 2, unsigned char ByteAl = 1);
+                unsigned char ShortAl = 2, unsigned char ByteAl = 1,
+                unsigned char BoolAl = 1);
 
   /// This constructor is used for targets that support arbitrary TargetData
   /// layouts, like the C backend.  It initializes the TargetData to match that





More information about the llvm-commits mailing list