2006-08-24 05:08:52 +08:00
|
|
|
//===-- PPCMachOWriter.cpp - Emit a Mach-O file for the PowerPC backend ---===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-01-17 17:06:13 +08:00
|
|
|
// This file was developed by Nate Begeman and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2006-08-24 05:08:52 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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"
|
2006-08-27 20:54:02 +08:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2006-08-24 05:08:52 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
2007-02-03 10:40:57 +08:00
|
|
|
struct VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter {
|
2007-01-24 11:40:33 +08:00
|
|
|
PPCMachOWriter(std::ostream &O, PPCTargetMachine &TM)
|
|
|
|
: MachOWriter(O, TM) {}
|
2006-09-09 06:42:09 +08:00
|
|
|
};
|
2006-08-24 05:08:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// addPPCMachOObjectWriterPass - Returns a pass that outputs the generated code
|
|
|
|
/// as a Mach-O object file.
|
|
|
|
///
|
2006-09-04 12:14:57 +08:00
|
|
|
void llvm::addPPCMachOObjectWriterPass(FunctionPassManager &FPM,
|
2006-08-24 05:08:52 +08:00
|
|
|
std::ostream &O, PPCTargetMachine &TM) {
|
2006-09-11 07:03:44 +08:00
|
|
|
PPCMachOWriter *MOW = new PPCMachOWriter(O, TM);
|
|
|
|
FPM.add(MOW);
|
|
|
|
FPM.add(createPPCCodeEmitterPass(TM, MOW->getMachineCodeEmitter()));
|
2006-08-24 05:08:52 +08:00
|
|
|
}
|