aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetData.h
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:28:02 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:28:02 +0000
commitf66723fc4b8bfebc17c8efa0753701d1c2840d5c (patch)
treee65ceb6d09859a953ef6bccf39d57c9e40c9f09e /include/llvm/Target/TargetData.h
parent242a8086aa6ccb29990aaf0c7a591003987330f1 (diff)
Add integer register size field.
Make all sizes and offsets uint64_t instead of uint. Fixed GetIndexedOffset to handle mixed array and struct indices. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetData.h')
-rw-r--r--include/llvm/Target/TargetData.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 52cb1b6e62..ce08aaa080 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -15,6 +15,7 @@
#include "llvm/Annotation.h"
#include <vector>
+#include <inttypes.h>
class Value;
class Type;
class StructType;
@@ -28,12 +29,15 @@ class TargetData {
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
static Annotation *TypeAnFactory(AnnotationID, const Annotable *, void *);
public:
- TargetData(const std::string &TargetName, unsigned char PtrSize = 8,
+ TargetData(const std::string &TargetName,
+ 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,
@@ -48,11 +52,12 @@ public:
unsigned char getDoubleAlignment() const { return DoubleAlignment; }
unsigned char getPointerAlignment() const { return PointerAlignment; }
unsigned char getPointerSize() const { return PointerSize; }
+ unsigned char getIntegerRegize() const { return IntegerRegSize; }
AnnotationID getStructLayoutAID() const { return AID; }
// getTypeSize - Return the number of bytes neccesary to hold the specified
// type
- unsigned getTypeSize (const Type *Ty) const;
+ uint64_t getTypeSize (const Type *Ty) const;
// getTypeAlignment - Return the minimum required alignment for the specified
// type
@@ -62,9 +67,9 @@ public:
// specified indices. This is used to implement getElementPtr and load and
// stores that include the implicit form of getelementptr.
//
- unsigned getIndexedOffset(const Type *Ty,
+ uint64_t getIndexedOffset(const Type *Ty,
const std::vector<Value*> &Indices) const;
-
+
inline const StructLayout *getStructLayout(const StructType *Ty) const {
return (const StructLayout*)
((const Annotable*)Ty)->getOrCreateAnnotation(AID);
@@ -76,8 +81,8 @@ public:
// TargetData structure.
//
struct StructLayout : public Annotation {
- std::vector<unsigned> MemberOffsets;
- unsigned StructSize;
+ std::vector<uint64_t> MemberOffsets;
+ uint64_t StructSize;
unsigned StructAlignment;
private:
friend class TargetData; // Only TargetData can create this class