blob: 407d0e33680e85cf158f1a831591ac07b894e993 [file] [log] [blame]
Wesley Pecka70f28c2010-02-23 19:15:24 +00001//===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze --- 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 MBlaze specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MBLAZE_TARGETMACHINE_H
15#define MBLAZE_TARGETMACHINE_H
16
17#include "MBlazeSubtarget.h"
18#include "MBlazeInstrInfo.h"
19#include "MBlazeISelLowering.h"
Dan Gohmanff7a5622010-05-11 17:31:57 +000020#include "MBlazeSelectionDAGInfo.h"
Wesley Pecka70f28c2010-02-23 19:15:24 +000021#include "MBlazeIntrinsicInfo.h"
Wesley Peck4e9141f2010-10-21 03:57:26 +000022#include "MBlazeELFWriterInfo.h"
23#include "llvm/MC/MCStreamer.h"
Wesley Pecka70f28c2010-02-23 19:15:24 +000024#include "llvm/Target/TargetMachine.h"
25#include "llvm/Target/TargetData.h"
26#include "llvm/Target/TargetFrameInfo.h"
27
28namespace llvm {
29 class formatted_raw_ostream;
30
31 class MBlazeTargetMachine : public LLVMTargetMachine {
32 MBlazeSubtarget Subtarget;
33 const TargetData DataLayout; // Calculates type size & alignment
34 MBlazeInstrInfo InstrInfo;
35 TargetFrameInfo FrameInfo;
36 MBlazeTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000037 MBlazeSelectionDAGInfo TSInfo;
Wesley Pecka70f28c2010-02-23 19:15:24 +000038 MBlazeIntrinsicInfo IntrinsicInfo;
Wesley Peck4e9141f2010-10-21 03:57:26 +000039 MBlazeELFWriterInfo ELFWriterInfo;
Wesley Pecka70f28c2010-02-23 19:15:24 +000040 public:
41 MBlazeTargetMachine(const Target &T, const std::string &TT,
42 const std::string &FS);
43
44 virtual const MBlazeInstrInfo *getInstrInfo() const
45 { return &InstrInfo; }
46
47 virtual const TargetFrameInfo *getFrameInfo() const
48 { return &FrameInfo; }
49
50 virtual const MBlazeSubtarget *getSubtargetImpl() const
51 { return &Subtarget; }
52
53 virtual const TargetData *getTargetData() const
54 { return &DataLayout;}
55
56 virtual const MBlazeRegisterInfo *getRegisterInfo() const
57 { return &InstrInfo.getRegisterInfo(); }
58
Dan Gohmand858e902010-04-17 15:26:15 +000059 virtual const MBlazeTargetLowering *getTargetLowering() const
60 { return &TLInfo; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000061
Dan Gohmanff7a5622010-05-11 17:31:57 +000062 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
63 { return &TSInfo; }
64
Wesley Pecka70f28c2010-02-23 19:15:24 +000065 const TargetIntrinsicInfo *getIntrinsicInfo() const
66 { return &IntrinsicInfo; }
67
Wesley Peck4e9141f2010-10-21 03:57:26 +000068 virtual const MBlazeELFWriterInfo *getELFWriterInfo() const {
69 return &ELFWriterInfo;
70 }
71
Wesley Pecka70f28c2010-02-23 19:15:24 +000072 // Pass Pipeline Configuration
73 virtual bool addInstSelector(PassManagerBase &PM,
74 CodeGenOpt::Level OptLevel);
75
76 virtual bool addPreEmitPass(PassManagerBase &PM,
77 CodeGenOpt::Level OptLevel);
78 };
79} // End llvm namespace
80
81#endif