mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
* 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
This commit is contained in:
parent
62eaf7ef60
commit
c56406c236
@ -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; }
|
||||
|
@ -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
|
||||
|
@ -125,16 +125,12 @@ UltraSparcFrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo,
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
UltraSparc::UltraSparc()
|
||||
: TargetMachine("UltraSparc-Native"),
|
||||
: TargetMachine("UltraSparc-Native", 4),
|
||||
schedInfo(*this),
|
||||
regInfo(*this),
|
||||
frameInfo(*this),
|
||||
cacheInfo(*this),
|
||||
optInfo(*this)
|
||||
{
|
||||
optSizeForSubWordData = 4;
|
||||
minMemOpWordSize = 8;
|
||||
maxAtomicMemOpWordSize = 8;
|
||||
optInfo(*this) {
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ Annotation *TargetData::TypeAnFactory(AnnotationID AID, const Annotable *T,
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
TargetData::TargetData(const std::string &TargetName,
|
||||
bool isLittleEndian,
|
||||
bool isLittleEndian, unsigned char SubWordSize,
|
||||
unsigned char IntRegSize, unsigned char PtrSize,
|
||||
unsigned char PtrAl, unsigned char DoubleAl,
|
||||
unsigned char FloatAl, unsigned char LongAl,
|
||||
@ -91,6 +91,7 @@ TargetData::TargetData(const std::string &TargetName,
|
||||
AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this);
|
||||
|
||||
LittleEndian = isLittleEndian;
|
||||
SubWordDataSize = SubWordSize;
|
||||
IntegerRegSize = IntRegSize;
|
||||
PointerSize = PtrSize;
|
||||
PointerAlignment = PtrAl;
|
||||
|
Loading…
Reference in New Issue
Block a user