1 //===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the X86 specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86TARGETMACHINE_H
15 #define X86TARGETMACHINE_H
18 #include "X86FrameLowering.h"
19 #include "X86ISelLowering.h"
20 #include "X86InstrInfo.h"
21 #include "X86JITInfo.h"
22 #include "X86SelectionDAGInfo.h"
23 #include "X86Subtarget.h"
24 #include "llvm/IR/DataLayout.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
32 class X86TargetMachine : public LLVMTargetMachine {
33 virtual void anchor();
34 X86Subtarget Subtarget;
35 X86FrameLowering FrameLowering;
36 InstrItineraryData InstrItins;
37 const DataLayout DL; // Calculates type size & alignment
38 X86InstrInfo InstrInfo;
39 X86TargetLowering TLInfo;
40 X86SelectionDAGInfo TSInfo;
44 X86TargetMachine(const Target &T, StringRef TT,
45 StringRef CPU, StringRef FS, const TargetOptions &Options,
46 Reloc::Model RM, CodeModel::Model CM,
47 CodeGenOpt::Level OL);
49 virtual const DataLayout *getDataLayout() const { return &DL; }
50 virtual const X86InstrInfo *getInstrInfo() const {
53 virtual const TargetFrameLowering *getFrameLowering() const {
54 return &FrameLowering;
56 virtual X86JITInfo *getJITInfo() {
59 virtual const X86Subtarget *getSubtargetImpl() const{ return &Subtarget; }
60 virtual const X86TargetLowering *getTargetLowering() const {
63 virtual const X86SelectionDAGInfo *getSelectionDAGInfo() const {
66 virtual const X86RegisterInfo *getRegisterInfo() const {
67 return &getInstrInfo()->getRegisterInfo();
69 virtual const InstrItineraryData *getInstrItineraryData() const {
73 /// \brief Register X86 analysis passes with a pass manager.
74 virtual void addAnalysisPasses(PassManagerBase &PM);
76 // Set up the pass pipeline.
77 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
79 virtual bool addCodeEmitter(PassManagerBase &PM,
83 } // End llvm namespace