blob: a64da9fca2b8dc210ed7cf22c5dbad8e6214d8d1 [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.
39 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
40 IA64TargetMachine &tm,
41 CodeGenOpt::Level OptLevel,
42 bool verbose);
43 static AsmPrinterCtorFn AsmPrinterCtor;
44
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045public:
46 IA64TargetMachine(const Module &M, const std::string &FS);
47
48 virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
49 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
Dan Gohmanfecb35a2009-01-16 22:49:36 +000050 virtual const IA64Subtarget *getSubtargetImpl() const { return &Subtarget; }
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000051 virtual IA64TargetLowering *getTargetLowering() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000052 return const_cast<IA64TargetLowering*>(&TLInfo);
53 }
Dan Gohmanb41dfba2008-05-14 01:58:56 +000054 virtual const IA64RegisterInfo *getRegisterInfo() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000055 return &InstrInfo.getRegisterInfo();
56 }
57 virtual const TargetData *getTargetData() const { return &DataLayout; }
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000058
Dan Gohmanf17a25c2007-07-18 16:29:46 +000059 static unsigned getModuleMatchQuality(const Module &M);
60
61 // Pass Pipeline Configuration
Bill Wendling5ed22ac2009-04-29 23:29:43 +000062 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
63 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
64 virtual bool addAssemblyEmitter(PassManagerBase &PM,
65 CodeGenOpt::Level OptLevel,
Evan Cheng42ceb472009-03-25 01:47:28 +000066 bool Verbose, raw_ostream &Out);
Anton Korobeynikovbab832e2009-06-19 19:36:55 +000067
68 static void registerAsmPrinter(AsmPrinterCtorFn F) {
69 AsmPrinterCtor = F;
70 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000071};
72} // End llvm namespace
73
74#endif
75
76