blob: e82bf59c964616e8973a9649ea07c61fe4910923 [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,
Daniel Dunbarfe5939f2009-07-15 20:24:03 +000040 TargetMachine &tm,
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000041 bool verbose);
42 static AsmPrinterCtorFn AsmPrinterCtor;
43
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044public:
Daniel Dunbarfe5939f2009-07-15 20:24:03 +000045 IA64TargetMachine(const Target &T, 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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058 // Pass Pipeline Configuration
Bill Wendling5ed22ac2009-04-29 23:29:43 +000059 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
60 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
61 virtual bool addAssemblyEmitter(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel,
David Greene302008d2009-07-14 20:18:05 +000063 bool Verbose, formatted_raw_ostream &Out);
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000064
65 static void registerAsmPrinter(AsmPrinterCtorFn F) {
66 AsmPrinterCtor = F;
67 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000068};
69} // End llvm namespace
70
71#endif
72
73