blob: a63aa54b9f55216e1c5f2c60fcadf0e944a13b34 [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"
Dan Gohmanff7a5622010-05-11 17:31:57 +000023#include "BlackfinSelectionDAGInfo.h"
Jakob Stoklund Olesen6ad8c842009-10-15 18:50:52 +000024#include "BlackfinIntrinsicInfo.h"
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000025
26namespace llvm {
27
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000028 class BlackfinTargetMachine : public LLVMTargetMachine {
29 const TargetData DataLayout;
30 BlackfinSubtarget Subtarget;
31 BlackfinTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000032 BlackfinSelectionDAGInfo TSInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000033 BlackfinInstrInfo InstrInfo;
34 TargetFrameInfo FrameInfo;
Jakob Stoklund Olesen6ad8c842009-10-15 18:50:52 +000035 BlackfinIntrinsicInfo IntrinsicInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000036 public:
Daniel Dunbare28039c2009-08-02 23:37:13 +000037 BlackfinTargetMachine(const Target &T, const std::string &TT,
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000038 const std::string &FS);
39
40 virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; }
41 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
42 virtual const BlackfinSubtarget *getSubtargetImpl() const {
43 return &Subtarget;
44 }
45 virtual const BlackfinRegisterInfo *getRegisterInfo() const {
46 return &InstrInfo.getRegisterInfo();
47 }
Dan Gohmand858e902010-04-17 15:26:15 +000048 virtual const BlackfinTargetLowering* getTargetLowering() const {
49 return &TLInfo;
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000050 }
Dan Gohmanff7a5622010-05-11 17:31:57 +000051 virtual const BlackfinSelectionDAGInfo* getSelectionDAGInfo() const {
52 return &TSInfo;
53 }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000054 virtual const TargetData *getTargetData() const { return &DataLayout; }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000055 virtual bool addInstSelector(PassManagerBase &PM,
56 CodeGenOpt::Level OptLevel);
Jakob Stoklund Olesen6ad8c842009-10-15 18:50:52 +000057 const TargetIntrinsicInfo *getIntrinsicInfo() const {
58 return &IntrinsicInfo;
59 }
Jakob Stoklund Olesend9509412009-08-02 17:32:10 +000060 };
61
62} // end namespace llvm
63
64#endif