2016-05-06 18:12:31 +08:00
|
|
|
//===-- AVRTargetMachine.h - Define TargetMachine for AVR -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the AVR specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_AVR_TARGET_MACHINE_H
|
|
|
|
#define LLVM_AVR_TARGET_MACHINE_H
|
|
|
|
|
|
|
|
#include "llvm/IR/DataLayout.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
#include "AVRFrameLowering.h"
|
|
|
|
#include "AVRISelLowering.h"
|
|
|
|
#include "AVRInstrInfo.h"
|
|
|
|
#include "AVRSelectionDAGInfo.h"
|
|
|
|
#include "AVRSubtarget.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2016-05-18 17:43:01 +08:00
|
|
|
/// A generic AVR implementation.
|
2017-10-13 06:57:28 +08:00
|
|
|
class AVRTargetMachine : public LLVMTargetMachine {
|
2016-05-06 18:12:31 +08:00
|
|
|
public:
|
|
|
|
AVRTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
2017-08-04 13:48:20 +08:00
|
|
|
StringRef FS, const TargetOptions &Options,
|
2017-10-13 06:57:28 +08:00
|
|
|
Optional<Reloc::Model> RM,
|
|
|
|
Optional<CodeModel::Model> CM,
|
2017-08-04 13:48:20 +08:00
|
|
|
CodeGenOpt::Level OL, bool JIT);
|
2016-05-06 18:12:31 +08:00
|
|
|
|
|
|
|
const AVRSubtarget *getSubtargetImpl() const;
|
|
|
|
const AVRSubtarget *getSubtargetImpl(const Function &) const override;
|
|
|
|
|
|
|
|
TargetLoweringObjectFile *getObjFileLowering() const override {
|
|
|
|
return this->TLOF.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
|
|
|
|
2017-06-01 02:41:23 +08:00
|
|
|
bool isMachineVerifierClean() const override {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-05-06 18:12:31 +08:00
|
|
|
private:
|
|
|
|
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
|
|
|
AVRSubtarget SubTarget;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_AVR_TARGET_MACHINE_H
|