| 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 | |
| 15 | using namespace llvm; |
| 16 | using namespace object; |
| 17 | |
| 18 | Binary::~Binary() = default; |
| 19 | |
| 20 | Binary::Binary(unsigned int Type, MemoryBufferRef Source) |
| 21 | : TypeID(Type), Data(Source) {} |
| 22 | |
| 23 | StringRef Binary::getData() const { return Data.getBuffer(); } |
| 24 | |
| 25 | StringRef Binary::getFileName() const { return Data.getBufferIdentifier(); } |
| 26 | |
| 27 | MemoryBufferRef Binary::getMemoryBufferRef() const { return Data; } |
| 28 | |