blob: dceda68433eb34a7ea244d170fcec15513c5fbeb [file] [log] [blame]
Tim Northover53d32512014-03-29 07:34:53 +00001//===-- llvm/MC/MCLinkerOptimizationHint.cpp ----- LOH handling -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCLinkerOptimizationHint.h"
11#include "llvm/MC/MCAsmLayout.h"
12#include "llvm/Support/LEB128.h"
13#include "llvm/MC/MCStreamer.h"
14
15using namespace llvm;
16
Tim Northover53d32512014-03-29 07:34:53 +000017void MCLOHDirective::Emit_impl(raw_ostream &OutStream,
18 const MachObjectWriter &ObjWriter,
19 const MCAsmLayout &Layout) const {
20 const MCAssembler &Asm = Layout.getAssembler();
21 encodeULEB128(Kind, OutStream);
22 encodeULEB128(Args.size(), OutStream);
23 for (LOHArgs::const_iterator It = Args.begin(), EndIt = Args.end();
24 It != EndIt; ++It)
25 encodeULEB128(ObjWriter.getSymbolAddress(&Asm.getSymbolData(**It), Layout),
26 OutStream);
27}