From 10daaa141661d96843f3d8ece0e5a4c2da4b6e87 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Apr 2003 20:11:09 +0000 Subject: [PATCH] Remove two fields from TargetData which are target specific. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5963 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetData.h | 6 ------ include/llvm/Target/TargetMachine.h | 3 +-- lib/ExecutionEngine/Interpreter/Interpreter.cpp | 1 - lib/Target/SparcV9/SparcV9TargetMachine.cpp | 2 +- lib/Target/TargetData.cpp | 7 +------ lib/Target/X86/X86TargetMachine.cpp | 1 - tools/llc/llc.cpp | 3 +-- 7 files changed, 4 insertions(+), 19 deletions(-) diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 66176a5ff16..a9bf2182da5 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -24,7 +24,6 @@ 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 @@ -32,7 +31,6 @@ class TargetData : public ImmutablePass { unsigned char FloatAlignment; // Defaults to 4 bytes unsigned char DoubleAlignment; // Defaults to 8 bytes unsigned char PointerSize; // Defaults to 8 bytes - unsigned char IntegerRegSize; // Defaults to PointerSize = 8 bytes unsigned char PointerAlignment; // Defaults to 8 bytes AnnotationID AID; // AID for structure layout annotation @@ -40,8 +38,6 @@ class TargetData : public ImmutablePass { public: TargetData(const std::string &TargetName = "", bool LittleEndian = false, - unsigned char SubWordDataSize = 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, @@ -55,7 +51,6 @@ 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; } @@ -64,7 +59,6 @@ public: unsigned char getDoubleAlignment() const { return DoubleAlignment; } unsigned char getPointerAlignment() const { return PointerAlignment; } unsigned char getPointerSize() const { return PointerSize; } - unsigned char getIntegerRegSize() const { return IntegerRegSize; } AnnotationID getStructLayoutAID() const { return AID; } // getTypeSize - Return the number of bytes neccesary to hold the specified diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index 5c76ff28f80..041a724b0c3 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -35,12 +35,11 @@ class TargetMachine : public NonCopyableV { 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, LittleEndian, SubWordSize, IntRegSize, + : Name(name), DataLayout(name, LittleEndian, PtrSize, PtrAl, DoubleAl, FloatAl, LongAl, IntAl, ShortAl, ByteAl) {} public: diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/lib/ExecutionEngine/Interpreter/Interpreter.cpp index a22466a55d2..5c116757ca4 100644 --- a/lib/ExecutionEngine/Interpreter/Interpreter.cpp +++ b/lib/ExecutionEngine/Interpreter/Interpreter.cpp @@ -25,7 +25,6 @@ Interpreter::Interpreter(Module *M, unsigned Config, bool DebugMode, bool TraceMode) : ExecutionEngine(M), ExitCode(0), Debug(DebugMode), Trace(TraceMode), CurFrame(-1), TD("lli", (Config & TM::EndianMask) == TM::LittleEndian, - 1, 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4) { diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp index c0269052be5..74597155a20 100644 --- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -129,7 +129,7 @@ UltraSparcFrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo, //--------------------------------------------------------------------------- UltraSparc::UltraSparc() - : TargetMachine("UltraSparc-Native", false, 4), + : TargetMachine("UltraSparc-Native", false), schedInfo(*this), regInfo(*this), frameInfo(*this), diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 923031c4005..158f57e3acc 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -82,8 +82,7 @@ Annotation *TargetData::TypeAnFactory(AnnotationID AID, const Annotable *T, //===----------------------------------------------------------------------===// TargetData::TargetData(const std::string &TargetName, - bool isLittleEndian, unsigned char SubWordSize, - unsigned char IntRegSize, unsigned char PtrSize, + bool isLittleEndian, unsigned char PtrSize, unsigned char PtrAl, unsigned char DoubleAl, unsigned char FloatAl, unsigned char LongAl, unsigned char IntAl, unsigned char ShortAl, @@ -99,8 +98,6 @@ TargetData::TargetData(const std::string &TargetName, "ERROR: Tool did not specify a target data to use!"); LittleEndian = isLittleEndian; - SubWordDataSize = SubWordSize; - IntegerRegSize = IntRegSize; PointerSize = PtrSize; PointerAlignment = PtrAl; DoubleAlignment = DoubleAl; @@ -118,8 +115,6 @@ TargetData::TargetData(const std::string &ToolName, const Module *M) AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this); LittleEndian = M->isLittleEndian(); - SubWordDataSize = 1; - IntegerRegSize = 8; PointerSize = M->has32BitPointers() ? 4 : 8; PointerAlignment = PointerSize; DoubleAlignment = PointerSize; diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index be0102f9338..d5a628cb670 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -35,7 +35,6 @@ TargetMachine *allocateX86TargetMachine(unsigned Configuration) { X86TargetMachine::X86TargetMachine(unsigned Config) : TargetMachine("X86", (Config & TM::EndianMask) == TM::LittleEndian, - 1, 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4), diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index f671a449592..85e41501415 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -184,8 +184,7 @@ main(int argc, char **argv) // Build up all of the passes that we want to do to the module... PassManager Passes; - Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getSubWordDataSize(), - TD.getIntegerRegSize(), TD.getPointerSize(), + Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getPointerSize(), TD.getPointerAlignment(), TD.getDoubleAlignment())); // Create a new optimization pass for each one specified on the command line -- 2.34.1