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;
27 MCMachObjectTargetWriter(bool Is64Bit_, uint32_t CPUType_,
29 bool UseAggressiveSymbolFolding_ = false);
32 virtual ~MCMachObjectTargetWriter();
37 bool is64Bit() const { return Is64Bit; }
38 bool useAggressiveSymbolFolding() const { return UseAggressiveSymbolFolding; }
39 uint32_t getCPUType() const { return CPUType; }
40 uint32_t getCPUSubtype() const { return CPUSubtype; }
45 /// \brief Construct a new Mach-O writer instance.
47 /// This routine takes ownership of the target writer subclass.
49 /// \param MOTW - The target specific Mach-O writer subclass.
50 /// \param OS - The stream to write to.
51 /// \returns The constructed object writer.
52 MCObjectWriter *createMachObjectWriter(MCMachObjectTargetWriter *MOTW,
53 raw_ostream &OS, bool IsLittleEndian);
55 } // End llvm namespace