blob: 8340052f2c0277acd7faaf47a3fbc160840619d9 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- IA64TargetMachine.h - Define TargetMachine for IA64 ---*- C++ -*---===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the IA64 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGET_IA64TARGETMACHINE_H
15#define LLVM_TARGET_IA64TARGETMACHINE_H
16
17#include "llvm/Target/TargetMachine.h"
18#include "llvm/Target/TargetData.h"
19#include "llvm/Target/TargetFrameInfo.h"
20#include "IA64InstrInfo.h"
21#include "IA64ISelLowering.h"
Dan Gohmanfecb35a2009-01-16 22:49:36 +000022#include "IA64Subtarget.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023
24namespace llvm {
25
26class IA64TargetMachine : public LLVMTargetMachine {
Dan Gohmanfecb35a2009-01-16 22:49:36 +000027 IA64Subtarget Subtarget;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000028 const TargetData DataLayout; // Calculates type size & alignment
29 IA64InstrInfo InstrInfo;
30 TargetFrameInfo FrameInfo;
31 //IA64JITInfo JITInfo;
32 IA64TargetLowering TLInfo;
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000033
Dan Gohmanf17a25c2007-07-18 16:29:46 +000034protected:
35 virtual const TargetAsmInfo *createTargetAsmInfo() const;
36
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000037 // To avoid having target depend on the asmprinter stuff libraries, asmprinter
38 // set this functions to ctor pointer at startup time if they are linked in.
David Greene302008d2009-07-14 20:18:05 +000039 typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
Stuart Hastings1721b8d2009-07-15 17:27:11 +000040 IA64TargetMachine &tm,
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000041 bool verbose);
42 static AsmPrinterCtorFn AsmPrinterCtor;
43
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044public:
Stuart Hastings1721b8d2009-07-15 17:27:11 +000045 IA64TargetMachine(const Module &M, const std::string &FS);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046
47 virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
48 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanfecb35a2009-01-16 22:49:36 +000049 virtual const IA64Subtarget *getSubtargetImpl() const { return &Subtarget; }
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000050 virtual IA64TargetLowering *getTargetLowering() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051 return const_cast<IA64TargetLowering*>(&TLInfo);
52 }
Dan Gohmanb41dfba2008-05-14 01:58:56 +000053 virtual const IA64RegisterInfo *getRegisterInfo() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000054 return &InstrInfo.getRegisterInfo();
55 }
56 virtual const TargetData *getTargetData() const { return &DataLayout; }
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000057
Stuart Hastings1721b8d2009-07-15 17:27:11 +000058 static unsigned getModuleMatchQuality(const Module &M);
59
Dan Gohmanf17a25c2007-07-18 16:29:46 +000060 // Pass Pipeline Configuration
Bill Wendling5ed22ac2009-04-29 23:29:43 +000061 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
62 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
63 virtual bool addAssemblyEmitter(PassManagerBase &PM,
64 CodeGenOpt::Level OptLevel,
David Greene302008d2009-07-14 20:18:05 +000065 bool Verbose, formatted_raw_ostream &Out);
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000066
67 static void registerAsmPrinter(AsmPrinterCtorFn F) {
68 AsmPrinterCtor = F;
69 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000070};
71} // End llvm namespace
72
73#endif
74
75