LLVM 24.0.0git
Binary.cpp
Go to the documentation of this file.
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
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
MemoryBufferRef Data
Definition Binary.h:38
StringRef getData() const
Definition Binary.cpp:23
MemoryBufferRef getMemoryBufferRef() const
Definition Binary.cpp:27
StringRef getFileName() const
Definition Binary.cpp:25
This is an optimization pass for GlobalISel generic memory operations.