mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-30 18:28:39 +00:00
Make TargetData no longer use annotations!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11874 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,9 +21,9 @@
|
|||||||
#define LLVM_TARGET_TARGETDATA_H
|
#define LLVM_TARGET_TARGETDATA_H
|
||||||
|
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "Support/Annotation.h"
|
|
||||||
#include "Support/DataTypes.h"
|
#include "Support/DataTypes.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
@@ -42,9 +42,6 @@ class TargetData : public ImmutablePass {
|
|||||||
unsigned char DoubleAlignment; // Defaults to 8 bytes
|
unsigned char DoubleAlignment; // Defaults to 8 bytes
|
||||||
unsigned char PointerSize; // Defaults to 8 bytes
|
unsigned char PointerSize; // Defaults to 8 bytes
|
||||||
unsigned char PointerAlignment; // Defaults to 8 bytes
|
unsigned char PointerAlignment; // Defaults to 8 bytes
|
||||||
AnnotationID AID; // AID for structure layout annotation
|
|
||||||
|
|
||||||
static Annotation *TypeAnFactory(AnnotationID, const Annotable *, void *);
|
|
||||||
public:
|
public:
|
||||||
TargetData(const std::string &TargetName = "",
|
TargetData(const std::string &TargetName = "",
|
||||||
bool LittleEndian = false,
|
bool LittleEndian = false,
|
||||||
@@ -69,7 +66,6 @@ public:
|
|||||||
unsigned char getDoubleAlignment() const { return DoubleAlignment; }
|
unsigned char getDoubleAlignment() const { return DoubleAlignment; }
|
||||||
unsigned char getPointerAlignment() const { return PointerAlignment; }
|
unsigned char getPointerAlignment() const { return PointerAlignment; }
|
||||||
unsigned char getPointerSize() const { return PointerSize; }
|
unsigned char getPointerSize() const { return PointerSize; }
|
||||||
AnnotationID getStructLayoutAID() const { return AID; }
|
|
||||||
|
|
||||||
/// getTypeSize - Return the number of bytes necessary to hold the specified
|
/// getTypeSize - Return the number of bytes necessary to hold the specified
|
||||||
/// type
|
/// type
|
||||||
@@ -89,23 +85,19 @@ public:
|
|||||||
uint64_t getIndexedOffset(const Type *Ty,
|
uint64_t getIndexedOffset(const Type *Ty,
|
||||||
const std::vector<Value*> &Indices) const;
|
const std::vector<Value*> &Indices) const;
|
||||||
|
|
||||||
inline const StructLayout *getStructLayout(const StructType *Ty) const {
|
const StructLayout *getStructLayout(const StructType *Ty) const;
|
||||||
return (const StructLayout*)
|
|
||||||
((const Annotable*)Ty)->getOrCreateAnnotation(AID);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// This annotation (attached ONLY to StructType classes) is used to lazily
|
// This object is used to lazily calculate structure layout information for a
|
||||||
// calculate structure layout information for a target machine, based on the
|
// target machine, based on the TargetData structure.
|
||||||
// TargetData structure.
|
|
||||||
//
|
//
|
||||||
struct StructLayout : public Annotation {
|
struct StructLayout {
|
||||||
std::vector<uint64_t> MemberOffsets;
|
std::vector<uint64_t> MemberOffsets;
|
||||||
uint64_t StructSize;
|
uint64_t StructSize;
|
||||||
unsigned StructAlignment;
|
unsigned StructAlignment;
|
||||||
private:
|
private:
|
||||||
friend class TargetData; // Only TargetData can create this class
|
friend class TargetData; // Only TargetData can create this class
|
||||||
inline StructLayout(const StructType *ST, const TargetData &TD);
|
StructLayout(const StructType *ST, const TargetData &TD);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
Reference in New Issue
Block a user