2006-02-05 06:50:24 +01:00
|
|
|
//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 21:36:04 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-02-05 06:50:24 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the Sparc specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPARCTARGETMACHINE_H
|
|
|
|
#define SPARCTARGETMACHINE_H
|
|
|
|
|
|
|
|
#include "SparcInstrInfo.h"
|
2008-10-03 18:55:19 +02:00
|
|
|
#include "SparcISelLowering.h"
|
2011-01-10 13:39:04 +01:00
|
|
|
#include "SparcFrameLowering.h"
|
2010-05-11 19:31:57 +02:00
|
|
|
#include "SparcSelectionDAGInfo.h"
|
2010-11-15 01:06:54 +01:00
|
|
|
#include "SparcSubtarget.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
2011-01-10 13:39:04 +01:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2006-02-05 06:50:24 +01:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2006-09-04 06:14:57 +02:00
|
|
|
class SparcTargetMachine : public LLVMTargetMachine {
|
2006-02-05 06:50:24 +01:00
|
|
|
SparcSubtarget Subtarget;
|
2010-02-04 07:34:01 +01:00
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
2008-10-03 18:55:19 +02:00
|
|
|
SparcTargetLowering TLInfo;
|
2010-05-11 19:31:57 +02:00
|
|
|
SparcSelectionDAGInfo TSInfo;
|
2006-02-05 06:50:24 +01:00
|
|
|
SparcInstrInfo InstrInfo;
|
2011-01-10 13:39:04 +01:00
|
|
|
SparcFrameLowering FrameLowering;
|
2006-02-05 06:50:24 +01:00
|
|
|
public:
|
2009-08-03 01:37:13 +02:00
|
|
|
SparcTargetMachine(const Target &T, const std::string &TT,
|
2011-06-30 03:53:36 +02:00
|
|
|
const std::string &CPU, const std::string &FS,
|
|
|
|
bool is64bit);
|
2006-02-05 06:50:24 +01:00
|
|
|
|
|
|
|
virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2011-01-10 13:39:04 +01:00
|
|
|
virtual const TargetFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2008-05-14 03:58:56 +02:00
|
|
|
virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
|
|
|
|
virtual const SparcRegisterInfo *getRegisterInfo() const {
|
2006-02-05 06:50:24 +01:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2010-04-17 17:26:15 +02:00
|
|
|
virtual const SparcTargetLowering* getTargetLowering() const {
|
|
|
|
return &TLInfo;
|
2008-10-03 18:55:19 +02:00
|
|
|
}
|
2010-05-11 19:31:57 +02:00
|
|
|
virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
2006-05-03 03:29:57 +02:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
2006-02-05 06:50:24 +01:00
|
|
|
|
2006-09-04 06:14:57 +02:00
|
|
|
// Pass Pipeline Configuration
|
2009-04-30 01:29:43 +02:00
|
|
|
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
|
|
|
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
2006-02-05 06:50:24 +01:00
|
|
|
};
|
|
|
|
|
2010-02-04 07:34:01 +01:00
|
|
|
/// SparcV8TargetMachine - Sparc 32-bit target machine
|
|
|
|
///
|
|
|
|
class SparcV8TargetMachine : public SparcTargetMachine {
|
|
|
|
public:
|
|
|
|
SparcV8TargetMachine(const Target &T, const std::string &TT,
|
2011-06-30 03:53:36 +02:00
|
|
|
const std::string &CPU, const std::string &FS);
|
2010-02-04 07:34:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/// SparcV9TargetMachine - Sparc 64-bit target machine
|
|
|
|
///
|
|
|
|
class SparcV9TargetMachine : public SparcTargetMachine {
|
|
|
|
public:
|
|
|
|
SparcV9TargetMachine(const Target &T, const std::string &TT,
|
2011-06-30 03:53:36 +02:00
|
|
|
const std::string &CPU, const std::string &FS);
|
2010-02-04 07:34:01 +01:00
|
|
|
};
|
|
|
|
|
2006-02-05 06:50:24 +01:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|