[RISCV][GISel] Support f32/f64 powi. (#117937)
[llvm-project.git] / lldb / source / Utility / DataBufferLLVM.cpp
blob376fe0689ecf011cc9d694a8ef380a276b1b6bcb
1 //===-- DataBufferLLVM.cpp ------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "lldb/Utility/DataBufferLLVM.h"
11 #include "llvm/Support/MemoryBuffer.h"
13 #include <cassert>
15 using namespace lldb_private;
17 DataBufferLLVM::DataBufferLLVM(std::unique_ptr<llvm::MemoryBuffer> MemBuffer)
18 : Buffer(std::move(MemBuffer)) {
19 assert(Buffer != nullptr &&
20 "Cannot construct a DataBufferLLVM with a null buffer");
23 DataBufferLLVM::~DataBufferLLVM() = default;
25 const uint8_t *DataBufferLLVM::GetBytesImpl() const {
26 return reinterpret_cast<const uint8_t *>(Buffer->getBufferStart());
29 lldb::offset_t DataBufferLLVM::GetByteSize() const {
30 return Buffer->getBufferSize();
33 WritableDataBufferLLVM::WritableDataBufferLLVM(
34 std::unique_ptr<llvm::WritableMemoryBuffer> MemBuffer)
35 : Buffer(std::move(MemBuffer)) {
36 assert(Buffer != nullptr &&
37 "Cannot construct a WritableDataBufferLLVM with a null buffer");
40 WritableDataBufferLLVM::~WritableDataBufferLLVM() = default;
42 const uint8_t *WritableDataBufferLLVM::GetBytesImpl() const {
43 return reinterpret_cast<const uint8_t *>(Buffer->getBufferStart());
46 lldb::offset_t WritableDataBufferLLVM::GetByteSize() const {
47 return Buffer->getBufferSize();
50 char DataBufferLLVM::ID;
51 char WritableDataBufferLLVM::ID;