mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-13 17:38:39 +00:00
add a new targetdata ctor to create a target data appropriate to the module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4bc8e640b8
commit
53a0c38b5f
@ -11,6 +11,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
|
#include "llvm/Module.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
|
|
||||||
@ -103,6 +104,23 @@ TargetData::TargetData(const std::string &TargetName,
|
|||||||
ByteAlignment = ByteAl;
|
ByteAlignment = ByteAl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TargetData::TargetData(const std::string &ToolName, const Module *M)
|
||||||
|
: AID(AnnotationManager::getID("TargetData::" + ToolName)) {
|
||||||
|
AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this);
|
||||||
|
|
||||||
|
LittleEndian = M->isLittleEndian();
|
||||||
|
SubWordDataSize = 1;
|
||||||
|
IntegerRegSize = 8;
|
||||||
|
PointerSize = M->has32BitPointers() ? 32 : 64;
|
||||||
|
PointerAlignment = PointerSize;
|
||||||
|
DoubleAlignment = 8;
|
||||||
|
FloatAlignment = 4;
|
||||||
|
LongAlignment = 8;
|
||||||
|
IntAlignment = 4;
|
||||||
|
ShortAlignment = 2;
|
||||||
|
ByteAlignment = 1;
|
||||||
|
}
|
||||||
|
|
||||||
TargetData::~TargetData() {
|
TargetData::~TargetData() {
|
||||||
AnnotationManager::registerAnnotationFactory(AID, 0); // Deregister factory
|
AnnotationManager::registerAnnotationFactory(AID, 0); // Deregister factory
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user