blob: 73ed3143f5309cf81d6699e22928b8421d62cb7e [file] [log] [blame]
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +00001//===-- BlackfinTargetMachine.h - TargetMachine for Blackfin ----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the Blackfin specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef BLACKFINTARGETMACHINE_H
15#define BLACKFINTARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18#include "llvm/Target/TargetData.h"
19#include "llvm/Target/TargetFrameInfo.h"
20#include "BlackfinInstrInfo.h"
21#include "BlackfinSubtarget.h"
22#include "BlackfinISelLowering.h"
23
24namespace llvm {
25
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000026 class BlackfinTargetMachine : public LLVMTargetMachine {
27 const TargetData DataLayout;
28 BlackfinSubtarget Subtarget;
29 BlackfinTargetLowering TLInfo;
30 BlackfinInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000032 public:
Daniel Dunbare28039c2009-08-02 23:37:13 +000033 BlackfinTargetMachine(const Target &T, const std::string &TT,
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000034 const std::string &FS);
35
36 virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; }
37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
38 virtual const BlackfinSubtarget *getSubtargetImpl() const {
39 return &Subtarget;
40 }
41 virtual const BlackfinRegisterInfo *getRegisterInfo() const {
42 return &InstrInfo.getRegisterInfo();
43 }
44 virtual BlackfinTargetLowering* getTargetLowering() const {
45 return const_cast<BlackfinTargetLowering*>(&TLInfo);
46 }
47 virtual const TargetData *getTargetData() const { return &DataLayout; }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000048 virtual bool addInstSelector(PassManagerBase &PM,
49 CodeGenOpt::Level OptLevel);
50 };
51
52} // end namespace llvm
53
54#endif