mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
e318391d4d
PPCMachOWriter is now trivial. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33818 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
//===-- PPCMachOWriter.cpp - Emit a Mach-O file for the PowerPC backend ---===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file was developed by Nate Begeman and is distributed under
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements a Mach-O writer for the PowerPC backend. The public
|
|
// interface to this file is the createPPCMachOObjectWriterPass function.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "PPCTargetMachine.h"
|
|
#include "llvm/PassManager.h"
|
|
#include "llvm/CodeGen/MachOWriter.h"
|
|
#include "llvm/Support/Compiler.h"
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
struct VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter {
|
|
PPCMachOWriter(std::ostream &O, PPCTargetMachine &TM)
|
|
: MachOWriter(O, TM) {}
|
|
};
|
|
}
|
|
|
|
/// addPPCMachOObjectWriterPass - Returns a pass that outputs the generated code
|
|
/// as a Mach-O object file.
|
|
///
|
|
void llvm::addPPCMachOObjectWriterPass(FunctionPassManager &FPM,
|
|
std::ostream &O, PPCTargetMachine &TM) {
|
|
PPCMachOWriter *MOW = new PPCMachOWriter(O, TM);
|
|
FPM.add(MOW);
|
|
FPM.add(createPPCCodeEmitterPass(TM, MOW->getMachineCodeEmitter()));
|
|
}
|