llvm-6502/lib/MC/MCLinkerOptimizationHint.cpp
Benjamin Kramer 190e0a1d63 Detemplatize LOHDirective.
The ARM64 backend uses it only as a container to keep an MCLOHType and
Arguments around so give it its own little copy. The other functionality
isn't used and we had a crazy method specialization hack in place to
keep it working. Unfortunately that was incompatible with MSVC.

Also range-ify a couple of loops while at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205114 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 19:21:20 +00:00

28 lines
1.0 KiB
C++

//===-- llvm/MC/MCLinkerOptimizationHint.cpp ----- LOH handling -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/Support/LEB128.h"
#include "llvm/MC/MCStreamer.h"
using namespace llvm;
void MCLOHDirective::Emit_impl(raw_ostream &OutStream,
const MachObjectWriter &ObjWriter,
const MCAsmLayout &Layout) const {
const MCAssembler &Asm = Layout.getAssembler();
encodeULEB128(Kind, OutStream);
encodeULEB128(Args.size(), OutStream);
for (LOHArgs::const_iterator It = Args.begin(), EndIt = Args.end();
It != EndIt; ++It)
encodeULEB128(ObjWriter.getSymbolAddress(&Asm.getSymbolData(**It), Layout),
OutStream);
}