1 //===-- llvm/MC/MCMachObjectWriter.h - Mach Object Writer -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCMACHOBJECTWRITER_H
11 #define LLVM_MC_MCMACHOBJECTWRITER_H
13 #include "llvm/MC/MCObjectWriter.h"
14 #include "llvm/Support/DataTypes.h"
18 class MCMachObjectTargetWriter {
19 const unsigned Is64Bit : 1;
20 const uint32_t CPUType;
21 const uint32_t CPUSubtype;
22 // FIXME: Remove this, we should just always use it once we no longer care
23 // about Darwin 'as' compatibility.
24 const unsigned UseAggressiveSymbolFolding : 1;
25 unsigned LocalDifference_RIT;
28 MCMachObjectTargetWriter(bool Is64Bit_, uint32_t CPUType_,
30 bool UseAggressiveSymbolFolding_ = false);
32 void setLocalDifferenceRelocationType(unsigned Type) {
33 LocalDifference_RIT = Type;
37 virtual ~MCMachObjectTargetWriter();
42 bool is64Bit() const { return Is64Bit; }
43 bool useAggressiveSymbolFolding() const { return UseAggressiveSymbolFolding; }
44 uint32_t getCPUType() const { return CPUType; }
45 uint32_t getCPUSubtype() const { return CPUSubtype; }
46 unsigned getLocalDifferenceRelocationType() const {
47 return LocalDifference_RIT;
53 /// \brief Construct a new Mach-O writer instance.
55 /// This routine takes ownership of the target writer subclass.
57 /// \param MOTW - The target specific Mach-O writer subclass.
58 /// \param OS - The stream to write to.
59 /// \returns The constructed object writer.
60 MCObjectWriter *createMachObjectWriter(MCMachObjectTargetWriter *MOTW,
61 raw_ostream &OS, bool IsLittleEndian);
63 } // End llvm namespace