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

Chris Lattner lattner at cs.uiuc.edu
Mon Dec 23 18:03:01 PST 2002


Changes in directory llvm/include/llvm/Target:

TargetMachine.h updated: 1.24 -> 1.25
TargetMachineImpls.h updated: 1.2 -> 1.3

---
Log message:

Allow the target machines to specify endianness and pointer size


---
Diffs of the changes:

Index: llvm/include/llvm/Target/TargetMachine.h
diff -u llvm/include/llvm/Target/TargetMachine.h:1.24 llvm/include/llvm/Target/TargetMachine.h:1.25
--- llvm/include/llvm/Target/TargetMachine.h:1.24	Tue Dec  3 23:20:12 2002
+++ llvm/include/llvm/Target/TargetMachine.h	Mon Dec 23 18:02:17 2002
@@ -39,13 +39,14 @@
   
 protected:
   TargetMachine(const std::string &name, // Can only create subclasses...
+		bool LittleEndian = false,
                 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)
-    : Name(name), DataLayout(name, SubWordSize, IntRegSize, PtrSize, PtrAl,
-                             DoubleAl, FloatAl, LongAl,
+    : Name(name), DataLayout(name, LittleEndian, SubWordSize, IntRegSize,
+			     PtrSize, PtrAl, DoubleAl, FloatAl, LongAl,
                              IntAl, ShortAl, ByteAl) {}
 public:
   virtual ~TargetMachine() {}


Index: llvm/include/llvm/Target/TargetMachineImpls.h
diff -u llvm/include/llvm/Target/TargetMachineImpls.h:1.2 llvm/include/llvm/Target/TargetMachineImpls.h:1.3
--- llvm/include/llvm/Target/TargetMachineImpls.h:1.2	Tue Oct 29 14:51:29 2002
+++ llvm/include/llvm/Target/TargetMachineImpls.h	Mon Dec 23 18:02:17 2002
@@ -8,6 +8,18 @@
 #ifndef LLVM_TARGET_TARGETMACHINEIMPLS_H
 #define LLVM_TARGET_TARGETMACHINEIMPLS_H
 
+namespace TM {
+  enum {
+    PtrSizeMask  = 1,
+    PtrSize32    = 0,
+    PtrSize64    = 1,
+
+    EndianMask   = 2,
+    LittleEndian = 0,
+    BigEndian    = 2,
+  };
+}
+
 class TargetMachine;
 
 // allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
@@ -16,8 +28,11 @@
 TargetMachine *allocateSparcTargetMachine();
 
 // allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
-// that implements the X86 backend.
+// that implements the X86 backend.  The X86 target machine can run in
+// "emulation" mode, where it is capable of emulating machines of larger pointer
+// size and different endianness if desired.
 //
-TargetMachine *allocateX86TargetMachine();
+TargetMachine *allocateX86TargetMachine(unsigned Configuration =
+					   TM::PtrSize32|TM::LittleEndian);
 
 #endif





More information about the llvm-commits mailing list