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

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 29 15:48:00 PST 2002


Changes in directory llvm/include/llvm/Target:

TargetData.h updated: 1.11 -> 1.12
TargetMachine.h updated: 1.16 -> 1.17

---
Log message:

* Privatize the TargetName
* Move optSizeForSubWordData to TargetData
* Remove unused fields



---
Diffs of the changes:

Index: llvm/include/llvm/Target/TargetData.h
diff -u llvm/include/llvm/Target/TargetData.h:1.11 llvm/include/llvm/Target/TargetData.h:1.12
--- llvm/include/llvm/Target/TargetData.h:1.11	Mon Oct 14 17:41:09 2002
+++ llvm/include/llvm/Target/TargetData.h	Tue Oct 29 15:47:17 2002
@@ -24,6 +24,7 @@
 
 class TargetData : public ImmutablePass {
   bool          LittleEndian;          // Defaults to false
+  unsigned char SubWordDataSize;       // Defaults to 1 byte (no rounding up)
   unsigned char ByteAlignment;         // Defaults to 1 bytes
   unsigned char ShortAlignment;        // Defaults to 2 bytes
   unsigned char IntAlignment;          // Defaults to 4 bytes
@@ -39,6 +40,7 @@
 public:
   TargetData(const std::string &TargetName = "SparcV9",
              bool LittleEndian = false,
+             unsigned char SubWordDataSize = 1,
              unsigned char IntRegSize = 8,
              unsigned char PtrSize = 8,
 	     unsigned char PtrAl = 8, unsigned char DoubleAl = 8,
@@ -52,6 +54,7 @@
   bool          isBigEndian()         const { return    !LittleEndian; }
 
   /// Target alignment constraints
+  unsigned char getSubWordDataSize()  const { return  SubWordDataSize; }
   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.16 llvm/include/llvm/Target/TargetMachine.h:1.17
--- llvm/include/llvm/Target/TargetMachine.h:1.16	Tue Oct 29 15:12:43 2002
+++ llvm/include/llvm/Target/TargetMachine.h	Tue Oct 29 15:47:17 2002
@@ -31,27 +31,25 @@
 //---------------------------------------------------------------------------
 
 class TargetMachine : public NonCopyableV {
+  const std::string Name;
 public:
-  const std::string TargetName;
   const TargetData DataLayout;		// Calculates type size & alignment
-  int              optSizeForSubWordData;
-  int	           minMemOpWordSize;
-  int	           maxAtomicMemOpWordSize;
   
 protected:
-  TargetMachine(const std::string &targetname, // Can only create subclasses...
-                unsigned char IntRegSize = 8,
+  TargetMachine(const std::string &name, // Can only create subclasses...
+                unsigned char SubWordSize = 1, unsigned char IntRegSize = 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)
-    : TargetName(targetname), DataLayout(targetname, IntRegSize,
-                                         PtrSize, PtrAl,
-					 DoubleAl, FloatAl, LongAl, IntAl, 
-					 ShortAl, ByteAl) { }
+    : Name(name), DataLayout(name, SubWordSize, IntRegSize, PtrSize, PtrAl,
+                             DoubleAl, FloatAl, LongAl,
+                             IntAl, ShortAl, ByteAl) {}
 public:
   virtual ~TargetMachine() {}
 
+  const std::string &getName() const { return Name; }
+  
   // 
   // Interfaces to the major aspects of target machine information:
   // -- Instruction opcode and operand information
@@ -70,7 +68,7 @@
 
   // Data storage information
   // 
-  virtual unsigned int	findOptimalStorageSize	(const Type* ty) const;
+  virtual unsigned findOptimalStorageSize(const Type* ty) const;
   
   /// addPassesToEmitAssembly - Add passes to the specified pass manager to get
   /// assembly langage code emited.  Typically this will involve several steps





More information about the llvm-commits mailing list