mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
89b9372605
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
54 lines
1.8 KiB
C++
54 lines
1.8 KiB
C++
//===-- PTXTargetMachine.cpp - Define TargetMachine for PTX ---------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Top-level implementation for the PTX target.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "PTX.h"
|
|
#include "PTXMCAsmInfo.h"
|
|
#include "PTXTargetMachine.h"
|
|
#include "llvm/PassManager.h"
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
|
|
using namespace llvm;
|
|
|
|
namespace llvm {
|
|
MCStreamer *createPTXAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
|
|
bool isVerboseAsm, bool useLoc,
|
|
MCInstPrinter *InstPrint,
|
|
MCCodeEmitter *CE,
|
|
bool ShowInst);
|
|
}
|
|
|
|
extern "C" void LLVMInitializePTXTarget() {
|
|
RegisterTargetMachine<PTXTargetMachine> X(ThePTXTarget);
|
|
RegisterAsmInfo<PTXMCAsmInfo> Y(ThePTXTarget);
|
|
TargetRegistry::RegisterAsmStreamer(ThePTXTarget, createPTXAsmStreamer);
|
|
}
|
|
|
|
// DataLayout and FrameInfo are filled with dummy data
|
|
PTXTargetMachine::PTXTargetMachine(const Target &T,
|
|
const std::string &TT,
|
|
const std::string &FS)
|
|
: LLVMTargetMachine(T, TT),
|
|
DataLayout("e-p:32:32-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"),
|
|
FrameInfo(Subtarget),
|
|
InstrInfo(*this),
|
|
TLInfo(*this),
|
|
Subtarget(TT, FS) {
|
|
}
|
|
|
|
bool PTXTargetMachine::addInstSelector(PassManagerBase &PM,
|
|
CodeGenOpt::Level OptLevel) {
|
|
PM.add(createPTXISelDag(*this, OptLevel));
|
|
PM.add(createPTXMFInfoExtract(*this, OptLevel));
|
|
return false;
|
|
}
|