blob: 19d3f5bd0f10022909a5ed29dda1b1945b886bb2 [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
Anton Korobeynikov33464912010-11-15 00:06:54 +000017#include "BlackfinInstrInfo.h"
18#include "BlackfinIntrinsicInfo.h"
19#include "BlackfinISelLowering.h"
20#include "BlackfinFrameInfo.h"
21#include "BlackfinSubtarget.h"
22#include "BlackfinSelectionDAGInfo.h"
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000023#include "llvm/Target/TargetMachine.h"
24#include "llvm/Target/TargetData.h"
25#include "llvm/Target/TargetFrameInfo.h"
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000026
27namespace llvm {
28
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000029 class BlackfinTargetMachine : public LLVMTargetMachine {
30 const TargetData DataLayout;
31 BlackfinSubtarget Subtarget;
32 BlackfinTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000033 BlackfinSelectionDAGInfo TSInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000034 BlackfinInstrInfo InstrInfo;
Anton Korobeynikov33464912010-11-15 00:06:54 +000035 BlackfinFrameInfo FrameInfo;
Jakob Stoklund Olesen6ad8c842009-10-15 18:50:52 +000036 BlackfinIntrinsicInfo IntrinsicInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000037 public:
Daniel Dunbare28039c2009-08-02 23:37:13 +000038 BlackfinTargetMachine(const Target &T, const std::string &TT,
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000039 const std::string &FS);
40
41 virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; }
42 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
43 virtual const BlackfinSubtarget *getSubtargetImpl() const {
44 return &Subtarget;
45 }
46 virtual const BlackfinRegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo();
48 }
Dan Gohmand858e902010-04-17 15:26:15 +000049 virtual const BlackfinTargetLowering* getTargetLowering() const {
50 return &TLInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000051 }
Dan Gohmanff7a5622010-05-11 17:31:57 +000052 virtual const BlackfinSelectionDAGInfo* getSelectionDAGInfo() const {
53 return &TSInfo;
54 }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000055 virtual const TargetData *getTargetData() const { return &DataLayout; }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000056 virtual bool addInstSelector(PassManagerBase &PM,
57 CodeGenOpt::Level OptLevel);
Jakob Stoklund Olesen6ad8c842009-10-15 18:50:52 +000058 const TargetIntrinsicInfo *getIntrinsicInfo() const {
59 return &IntrinsicInfo;
60 }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000061 };
62
63} // end namespace llvm
64
65#endif