blob: eb56d1e293266f430a1cbcf6384a71dedb95382f [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===--- DWARFEmitter.h - ---------------------------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8/// \file
Andrew Scullcdfcccc2018-10-05 20:58:37 +01009/// Common declarations for yaml2obj
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010010//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_OBJECTYAML_DWARFEMITTER_H
13#define LLVM_OBJECTYAML_DWARFEMITTER_H
14
15#include "llvm/ADT/StringMap.h"
16#include "llvm/ADT/StringRef.h"
17#include "llvm/Support/Error.h"
18#include "llvm/Support/Host.h"
19#include "llvm/Support/MemoryBuffer.h"
20#include <memory>
21
22namespace llvm {
23
24class raw_ostream;
25
26namespace DWARFYAML {
27
28struct Data;
29struct PubSection;
30
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020031Error emitDebugAbbrev(raw_ostream &OS, const Data &DI);
32Error emitDebugStr(raw_ostream &OS, const Data &DI);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010033
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020034Error emitDebugAranges(raw_ostream &OS, const Data &DI);
35Error emitDebugRanges(raw_ostream &OS, const Data &DI);
36Error emitDebugPubnames(raw_ostream &OS, const Data &DI);
37Error emitDebugPubtypes(raw_ostream &OS, const Data &DI);
38Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI);
39Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI);
40Error emitDebugInfo(raw_ostream &OS, const Data &DI);
41Error emitDebugLine(raw_ostream &OS, const Data &DI);
42Error emitDebugAddr(raw_ostream &OS, const Data &DI);
43Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
44Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
45Error emitDebugLoclists(raw_ostream &OS, const Data &DI);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010046
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020047std::function<Error(raw_ostream &, const Data &)>
48getDWARFEmitterByName(StringRef SecName);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010049Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020050emitDebugSections(StringRef YAMLString,
51 bool IsLittleEndian = sys::IsLittleEndianHost,
52 bool Is64BitAddrSize = true);
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010053} // end namespace DWARFYAML
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010054} // end namespace llvm
55
56#endif // LLVM_OBJECTYAML_DWARFEMITTER_H