mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
81b6ed7ed1
after itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22376 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
//===-- X86ELFWriter.cpp - Emit an ELF file for the X86 backend -----------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements an ELF writer for the X86 backend. The public interface
|
|
// to this file is the createX86ELFObjectWriterPass function.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "X86.h"
|
|
#include "llvm/PassManager.h"
|
|
#include "llvm/CodeGen/ELFWriter.h"
|
|
#include "llvm/Target/TargetMachine.h"
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
class X86ELFWriter : public ELFWriter {
|
|
public:
|
|
X86ELFWriter(std::ostream &O, TargetMachine &TM) : ELFWriter(O, TM) {
|
|
e_machine = 3; // EM_386
|
|
}
|
|
};
|
|
}
|
|
|
|
/// addX86ELFObjectWriterPass - Returns a pass that outputs the generated code
|
|
/// as an ELF object file.
|
|
///
|
|
void llvm::addX86ELFObjectWriterPass(PassManager &FPM,
|
|
std::ostream &O, TargetMachine &TM) {
|
|
X86ELFWriter *EW = new X86ELFWriter(O, TM);
|
|
FPM.add(EW);
|
|
FPM.add(createX86CodeEmitterPass(EW->getMachineCodeEmitter()));
|
|
}
|