the various ConstantExpr::get*Ty methods existed to work with issues around
[llvm/stm8.git] / lib / Target / Alpha / AlphaTargetMachine.cpp
blobb872fc63f232e516f0708a84d325e194457cdc18
1 //===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
11 //===----------------------------------------------------------------------===//
13 #include "Alpha.h"
14 #include "AlphaMCAsmInfo.h"
15 #include "AlphaTargetMachine.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Support/FormattedStream.h"
18 #include "llvm/Target/TargetRegistry.h"
19 using namespace llvm;
21 extern "C" void LLVMInitializeAlphaTarget() {
22 // Register the target.
23 RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
24 RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
27 AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
28 const std::string &CPU,
29 const std::string &FS)
30 : LLVMTargetMachine(T, TT, CPU, FS),
31 DataLayout("e-f128:128:128-n64"),
32 FrameLowering(Subtarget),
33 Subtarget(TT, CPU, FS),
34 TLInfo(*this),
35 TSInfo(*this) {
36 setRelocationModel(Reloc::PIC_);
40 //===----------------------------------------------------------------------===//
41 // Pass Pipeline Configuration
42 //===----------------------------------------------------------------------===//
44 bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
45 CodeGenOpt::Level OptLevel) {
46 PM.add(createAlphaISelDag(*this));
47 return false;
49 bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
50 CodeGenOpt::Level OptLevel) {
51 // Must run branch selection immediately preceding the asm printer
52 PM.add(createAlphaBranchSelectionPass());
53 PM.add(createAlphaLLRPPass(*this));
54 return false;