From e3fa53ee4df41925c90ad6cc6a4f132284a1ae66 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Fri, 23 Jul 2004 01:08:13 +0000 Subject: [PATCH] * Add a BoolAlignment field to TargetData, default is 1 byte * Fix spacing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15119 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetData.h | 33 ++++++++++++++++------------- include/llvm/Target/TargetMachine.h | 3 ++- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 1cc7ddb7d17..56ec5238b12 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -34,7 +34,8 @@ class StructLayout; class TargetData : public ImmutablePass { bool LittleEndian; // Defaults to false - unsigned char ByteAlignment; // Defaults to 1 bytes + unsigned char BoolAlignment; // Defaults to 1 byte + unsigned char ByteAlignment; // Defaults to 1 byte unsigned char ShortAlignment; // Defaults to 2 bytes unsigned char IntAlignment; // Defaults to 4 bytes unsigned char LongAlignment; // Defaults to 8 bytes @@ -47,23 +48,24 @@ public: TargetData(const std::string &TargetName = "", bool LittleEndian = false, 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); + 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, unsigned char BoolAl = 1); // Copy constructor TargetData (const TargetData &TD) : - ImmutablePass (), - LittleEndian (TD.isLittleEndian ()), - ByteAlignment (TD.getByteAlignment ()), - ShortAlignment (TD.getShortAlignment ()), - IntAlignment (TD.getIntAlignment ()), - LongAlignment (TD.getLongAlignment ()), - FloatAlignment (TD.getFloatAlignment ()), - DoubleAlignment (TD.getDoubleAlignment ()), - PointerSize (TD.getPointerSize ()), - PointerAlignment (TD.getPointerAlignment ()) { + ImmutablePass(), + LittleEndian(TD.isLittleEndian()), + BoolAlignment(TD.getBoolAlignment()), + ByteAlignment(TD.getByteAlignment()), + ShortAlignment(TD.getShortAlignment()), + IntAlignment(TD.getIntAlignment()), + LongAlignment(TD.getLongAlignment()), + FloatAlignment(TD.getFloatAlignment()), + DoubleAlignment(TD.getDoubleAlignment()), + PointerSize(TD.getPointerSize()), + PointerAlignment(TD.getPointerAlignment()) { } TargetData(const std::string &ToolName, const Module *M); @@ -74,6 +76,7 @@ public: bool isBigEndian() const { return !LittleEndian; } /// Target alignment constraints + unsigned char getBoolAlignment() const { return BoolAlignment; } 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 e958a23e1f1..8a2777f47ca 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -51,7 +51,8 @@ protected: // Can only create subclasses... 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); + unsigned char ShortAl = 2, unsigned char ByteAl = 1, + unsigned char BoolAl = 1); /// This constructor is used for targets that support arbitrary TargetData /// layouts, like the C backend. It initializes the TargetData to match that