Path: blob/main/contrib/llvm-project/lld/MachO/Dwarf.h
34869 views
//===- DWARF.h -----------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===-------------------------------------------------------------------===//78#ifndef LLD_MACHO_DWARF_H9#define LLD_MACHO_DWARF_H1011#include "llvm/ADT/StringRef.h"12#include "llvm/DebugInfo/DWARF/DWARFObject.h"1314namespace lld::macho {1516class ObjFile;1718// Implements the interface between LLVM's DWARF-parsing utilities and LLD's19// InputSection structures.20class DwarfObject final : public llvm::DWARFObject {21public:22bool isLittleEndian() const override { return true; }2324std::optional<llvm::RelocAddrEntry> find(const llvm::DWARFSection &sec,25uint64_t pos) const override {26// TODO: implement this27return std::nullopt;28}2930void forEachInfoSections(31llvm::function_ref<void(const llvm::DWARFSection &)> f) const override {32f(infoSection);33}3435llvm::StringRef getAbbrevSection() const override { return abbrevSection; }36llvm::StringRef getStrSection() const override { return strSection; }3738llvm::DWARFSection const &getLineSection() const override {39return lineSection;40}4142llvm::DWARFSection const &getStrOffsetsSection() const override {43return strOffsSection;44}4546// Returns an instance of DwarfObject if the given object file has the47// relevant DWARF debug sections.48static std::unique_ptr<DwarfObject> create(ObjFile *);4950private:51llvm::DWARFSection infoSection;52llvm::DWARFSection lineSection;53llvm::DWARFSection strOffsSection;54llvm::StringRef abbrevSection;55llvm::StringRef strSection;56};5758} // namespace lld::macho5960#endif616263