diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-29 21:48:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-29 21:48:17 +0000 |
commit | c56406c236478f718a2257c2b660561ebc855f16 (patch) | |
tree | 5a24a2b7f09c621d2b3c3b5d3c6c2795dfe677e4 /include | |
parent | 62eaf7ef60f607112f54580df6d0e8ced4ef9e62 (diff) | |
download | llvm-c56406c236478f718a2257c2b660561ebc855f16.tar.gz llvm-c56406c236478f718a2257c2b660561ebc855f16.tar.bz2 llvm-c56406c236478f718a2257c2b660561ebc855f16.tar.xz |
* Privatize the TargetName
* Move optSizeForSubWordData to TargetData
* Remove unused fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetData.h | 3 | ||||
-rw-r--r-- | include/llvm/Target/TargetMachine.h | 20 |
2 files changed, 12 insertions, 11 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 074345023f..b1ea6b9a17 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -24,6 +24,7 @@ class StructLayout; 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 @@ class TargetData : public ImmutablePass { 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 @@ public: 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; } diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index 860d67eeae..85ee5e077e 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -31,27 +31,25 @@ class Pass; //--------------------------------------------------------------------------- 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 @@ public: // 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 |