1//===- Binary.cpp - A generic binary file ---------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the Binary class.
10//
11//===----------------------------------------------------------------------===//
12
13#include "llvm/Object/Binary.h"
14
15using namespace llvm;
16using namespace object;
17
18Binary::~Binary() = default;
19
20Binary::Binary(unsigned int Type, MemoryBufferRef Source)
21 : TypeID(Type), Data(Source) {}
22
23StringRef Binary::getData() const { return Data.getBuffer(); }
24
25StringRef Binary::getFileName() const { return Data.getBufferIdentifier(); }
26
27MemoryBufferRef Binary::getMemoryBufferRef() const { return Data; }
28