blob: 262955698e441b9442051ff3e264b807960e56b0 [file] [log] [blame]
Chris Lattner02a3d832002-10-29 22:37:54 +00001//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
Misha Brukmanc88330a2005-04-21 23:38:14 +00002//
John Criswell29265fe2003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanc88330a2005-04-21 23:38:14 +00007//
John Criswell29265fe2003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Misha Brukmanc88330a2005-04-21 23:38:14 +00009//
Chris Lattner02a3d832002-10-29 22:37:54 +000010// This file declares the X86 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_X86_X86TARGETMACHINE_H
15#define LLVM_LIB_TARGET_X86_X86TARGETMACHINE_H
Chandler Carruth802d7552012-12-04 07:12:27 +000016#include "X86InstrInfo.h"
Anton Korobeynikovf7183ed2010-11-15 00:06:54 +000017#include "X86Subtarget.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000018#include "llvm/IR/DataLayout.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000019#include "llvm/Target/TargetMachine.h"
Chris Lattner02a3d832002-10-29 22:37:54 +000020
Brian Gaeke960707c2003-11-11 22:41:34 +000021namespace llvm {
Andrew Trick808a7a62012-02-03 05:12:30 +000022
Evan Cheng2129f592011-07-19 06:37:02 +000023class StringRef;
Brian Gaeke960707c2003-11-11 22:41:34 +000024
Craig Topperec828472014-03-31 06:53:13 +000025class X86TargetMachine final : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000026 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Eric Christopher8b770652015-01-26 19:03:15 +000027 X86Subtarget Subtarget;
Jim Laskeyae92ce82006-09-07 23:39:26 +000028
Eric Christopher3faf2f12014-10-06 06:45:36 +000029 mutable StringMap<std::unique_ptr<X86Subtarget>> SubtargetMap;
30
Chris Lattner02a3d832002-10-29 22:37:54 +000031public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000032 X86TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
33 StringRef FS, const TargetOptions &Options, Reloc::Model RM,
Eric Christopher8b770652015-01-26 19:03:15 +000034 CodeModel::Model CM, CodeGenOpt::Level OL);
Reid Kleckner357600e2014-11-20 23:37:18 +000035 ~X86TargetMachine() override;
Eric Christopher3faf2f12014-10-06 06:45:36 +000036 const X86Subtarget *getSubtargetImpl(const Function &F) const override;
Rafael Espindolab8141d52014-08-05 22:10:21 +000037
Chandler Carruth8b04c0d2015-02-01 13:20:00 +000038 TargetIRAnalysis getTargetIRAnalysis() override;
Chandler Carruth664e3542013-01-07 01:37:14 +000039
Chris Lattner12e97302006-09-04 04:14:57 +000040 // Set up the pass pipeline.
Craig Topper2d9361e2014-03-09 07:44:38 +000041 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000042 TargetLoweringObjectFile *getObjFileLowering() const override {
43 return TLOF.get();
44 }
Chris Lattner02a3d832002-10-29 22:37:54 +000045};
Evan Cheng11b0a5d2006-09-08 06:48:29 +000046
Alexander Kornienkof00654e2015-06-23 09:49:53 +000047} // End llvm namespace
Brian Gaeke960707c2003-11-11 22:41:34 +000048
Chris Lattner02a3d832002-10-29 22:37:54 +000049#endif