1 //===-- IA64TargetMachine.h - Define TargetMachine for IA64 ---*- 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 IA64 specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TARGET_IA64TARGETMACHINE_H
15 #define LLVM_TARGET_IA64TARGETMACHINE_H
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"
22 #include "IA64Subtarget.h"
26 class IA64TargetMachine : public LLVMTargetMachine {
27 IA64Subtarget Subtarget;
28 const TargetData DataLayout; // Calculates type size & alignment
29 IA64InstrInfo InstrInfo;
30 TargetFrameInfo FrameInfo;
31 //IA64JITInfo JITInfo;
32 IA64TargetLowering TLInfo;
35 virtual const TargetAsmInfo *createTargetAsmInfo() const;
37 // 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,
43 static AsmPrinterCtorFn AsmPrinterCtor;
46 IA64TargetMachine(const Module &M, const std::string &FS);
48 virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
49 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
50 virtual const IA64Subtarget *getSubtargetImpl() const { return &Subtarget; }
51 virtual IA64TargetLowering *getTargetLowering() const {
52 return const_cast<IA64TargetLowering*>(&TLInfo);
54 virtual const IA64RegisterInfo *getRegisterInfo() const {
55 return &InstrInfo.getRegisterInfo();
57 virtual const TargetData *getTargetData() const { return &DataLayout; }
59 static unsigned getModuleMatchQuality(const Module &M);
61 // Pass Pipeline Configuration
62 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,
66 bool Verbose, raw_ostream &Out);
68 static void registerAsmPrinter(AsmPrinterCtorFn F) {
72 } // End llvm namespace