opnsense-src/contrib/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp

55 lines
1.8 KiB
C++
Raw Normal View History

2009-06-02 13:52:33 -04:00
//===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
#include "Alpha.h"
2009-10-14 13:57:32 -04:00
#include "AlphaMCAsmInfo.h"
2009-06-02 13:52:33 -04:00
#include "AlphaTargetMachine.h"
#include "llvm/PassManager.h"
2009-10-14 13:57:32 -04:00
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetRegistry.h"
2009-06-02 13:52:33 -04:00
using namespace llvm;
2009-10-14 13:57:32 -04:00
extern "C" void LLVMInitializeAlphaTarget() {
// Register the target.
RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
RegisterAsmInfo<AlphaMCAsmInfo> Y(TheAlphaTarget);
2009-06-02 13:52:33 -04:00
}
2009-10-14 13:57:32 -04:00
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
const std::string &FS)
: LLVMTargetMachine(T, TT),
2009-11-18 09:58:34 -05:00
DataLayout("e-f128:128:128-n64"),
FrameLowering(Subtarget),
2009-10-14 13:57:32 -04:00
Subtarget(TT, FS),
2010-05-27 11:15:58 -04:00
TLInfo(*this),
TSInfo(*this) {
2009-06-02 13:52:33 -04:00
setRelocationModel(Reloc::PIC_);
}
//===----------------------------------------------------------------------===//
// Pass Pipeline Configuration
//===----------------------------------------------------------------------===//
bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
PM.add(createAlphaISelDag(*this));
return false;
}
bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
// Must run branch selection immediately preceding the asm printer
PM.add(createAlphaBranchSelectionPass());
PM.add(createAlphaLLRPPass(*this));
return false;
}