[OpenACC] Implement 'device_type' for 'data' construct
[llvm-project.git] / lldb / source / Plugins / SymbolFile / DWARF / DWARFDataExtractor.cpp
blobc5876502b8f299d94917bb2f56145f48725227b4
1 //===-- DWARFDataExtractor.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 "DWARFDataExtractor.h"
10 #include "llvm/ADT/StringRef.h"
12 namespace lldb_private {
14 uint64_t
15 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const {
16 return GetU32(offset_ptr);
19 dw_offset_t
20 DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const {
21 return GetMaxU64(offset_ptr, GetDWARFSizeOfOffset());
24 llvm::DWARFDataExtractor DWARFDataExtractor::GetAsLLVMDWARF() const {
25 return llvm::DWARFDataExtractor(llvm::ArrayRef(GetDataStart(), GetByteSize()),
26 GetByteOrder() == lldb::eByteOrderLittle,
27 GetAddressByteSize());
29 llvm::DataExtractor DWARFDataExtractor::GetAsLLVM() const {
30 return llvm::DataExtractor(llvm::ArrayRef(GetDataStart(), GetByteSize()),
31 GetByteOrder() == lldb::eByteOrderLittle,
32 GetAddressByteSize());
34 } // namespace lldb_private