blob: 45ad0785888787cd9dc8b9c7ae4c81a40235c420 [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"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000022#include "MBlazeFrameLowering.h"
Wesley Peck4e9141f2010-10-21 03:57:26 +000023#include "MBlazeELFWriterInfo.h"
24#include "llvm/MC/MCStreamer.h"
Wesley Pecka70f28c2010-02-23 19:15:24 +000025#include "llvm/Target/TargetMachine.h"
26#include "llvm/Target/TargetData.h"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000027#include "llvm/Target/TargetFrameLowering.h"
Wesley Pecka70f28c2010-02-23 19:15:24 +000028
29namespace llvm {
30 class formatted_raw_ostream;
31
32 class MBlazeTargetMachine : public LLVMTargetMachine {
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000033 MBlazeSubtarget Subtarget;
34 const TargetData DataLayout; // Calculates type size & alignment
35 MBlazeInstrInfo InstrInfo;
36 MBlazeFrameLowering FrameLowering;
37 MBlazeTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000038 MBlazeSelectionDAGInfo TSInfo;
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000039 MBlazeIntrinsicInfo IntrinsicInfo;
Wesley Peck4e9141f2010-10-21 03:57:26 +000040 MBlazeELFWriterInfo ELFWriterInfo;
Wesley Pecka70f28c2010-02-23 19:15:24 +000041 public:
42 MBlazeTargetMachine(const Target &T, const std::string &TT,
43 const std::string &FS);
44
45 virtual const MBlazeInstrInfo *getInstrInfo() const
46 { return &InstrInfo; }
47
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000048 virtual const TargetFrameLowering *getFrameLowering() const
49 { return &FrameLowering; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000050
51 virtual const MBlazeSubtarget *getSubtargetImpl() const
52 { return &Subtarget; }
53
54 virtual const TargetData *getTargetData() const
55 { return &DataLayout;}
56
57 virtual const MBlazeRegisterInfo *getRegisterInfo() const
58 { return &InstrInfo.getRegisterInfo(); }
59
Dan Gohmand858e902010-04-17 15:26:15 +000060 virtual const MBlazeTargetLowering *getTargetLowering() const
61 { return &TLInfo; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000062
Dan Gohmanff7a5622010-05-11 17:31:57 +000063 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
64 { return &TSInfo; }
65
Wesley Pecka70f28c2010-02-23 19:15:24 +000066 const TargetIntrinsicInfo *getIntrinsicInfo() const
67 { return &IntrinsicInfo; }
68
Wesley Peck4e9141f2010-10-21 03:57:26 +000069 virtual const MBlazeELFWriterInfo *getELFWriterInfo() const {
70 return &ELFWriterInfo;
71 }
72
Wesley Pecka70f28c2010-02-23 19:15:24 +000073 // Pass Pipeline Configuration
Wesley Peck8397be02010-12-09 03:42:04 +000074 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level Opt);
75 virtual bool addPreEmitPass(PassManagerBase &PM,CodeGenOpt::Level Opt);
Wesley Pecka70f28c2010-02-23 19:15:24 +000076 };
77} // End llvm namespace
78
79#endif