Add a new constructor

llvm-svn: 12087
This commit is contained in:
Chris Lattner 2004-03-03 02:12:47 +00:00
parent 7abcc387de
commit 87ed2a4096
2 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,12 @@ protected: // Can only create subclasses...
unsigned char DoubleAl = 8, unsigned char FloatAl = 4,
unsigned char LongAl = 8, unsigned char IntAl = 4,
unsigned char ShortAl = 2, unsigned char ByteAl = 1);
// This constructor is used for targets that support arbitrary TargetData
// layouts, like the C backend. It initializes the TargetData to match that
// of the specified module.
TargetMachine(const std::string &name, IntrinsicLowering *IL,
const Module &M);
public:
virtual ~TargetMachine();

View File

@ -30,6 +30,11 @@ TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
IntAl, ShortAl, ByteAl) {
IL = il ? il : new DefaultIntrinsicLowering();
}
TargetMachine::TargetMachine(const std::string &name, IntrinsicLowering *il,
const Module &M)
: Name(name), DataLayout(name, &M) {
IL = il ? il : new DefaultIntrinsicLowering();
}
TargetMachine::~TargetMachine() {
delete IL;