LLVM 22.0.0git
DWARFExpressionPrinter.h
Go to the documentation of this file.
1//===--- DWARFExpressionPRinter.h - DWARF Expression Printing ---*- C++ -*-===//
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#ifndef LLVM_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTER_H
10#define LLVM_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTER_H
11
12#include "llvm/ADT/StringRef.h"
13#include "llvm/ADT/iterator.h"
16
17namespace llvm {
18
19// This functionality is separated from the main data structure so that nothing
20// in DWARFExpression.cpp needs build-time dependencies on DWARFUnit or other
21// higher-level Dwarf structures. This approach creates better layering and
22// allows DWARFExpression to be used from code which can't have dependencies on
23// those higher-level structures.
24
25class DWARFUnit;
26struct DIDumpOptions;
27class raw_ostream;
28
29/// Print a Dwarf expression/
30/// \param E to be printed
31/// \param OS to this stream
32/// \param GetNameForDWARFReg callback to return dwarf register name
33LLVM_ABI void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS,
34 DIDumpOptions DumpOpts, DWARFUnit *U,
35 bool IsEH = false);
36
37/// Print the expression in a format intended to be compact and useful to a
38/// user, but not perfectly unambiguous, or capable of representing every
39/// valid DWARF expression. Returns true if the expression was sucessfully
40/// printed.
41///
42/// \param E to be printed
43/// \param OS to this stream
44/// \param GetNameForDWARFReg callback to return dwarf register name
45///
46/// \returns true if the expression was successfully printed
48 const DWARFExpression *E, raw_ostream &OS,
49 std::function<StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg =
50 nullptr);
51
52/// Pretty print a register opcode and operands.
53/// \param U within the context of this Dwarf unit, if any.
54/// \param OS to this stream
55/// \param DumpOpts with these options
56/// \param Opcode to print
57/// \param Operands to the opcode
58///
59/// returns true if the Op was successfully printed
60LLVM_ABI bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
61 DIDumpOptions DumpOpts, uint8_t Opcode,
62 ArrayRef<uint64_t> Operands);
63
64} // end namespace llvm
65
66#endif // LLVM_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTER_H
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition: Compiler.h:213
mir Rename Register Operands
raw_pwrite_stream & OS
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
LLVM_ABI void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS, DIDumpOptions DumpOpts, DWARFUnit *U, bool IsEH=false)
Print a Dwarf expression/.
LLVM_ABI bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS, DIDumpOptions DumpOpts, uint8_t Opcode, ArrayRef< uint64_t > Operands)
Pretty print a register opcode and operands.
LLVM_ABI bool printDwarfExpressionCompact(const DWARFExpression *E, raw_ostream &OS, std::function< StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg=nullptr)
Print the expression in a format intended to be compact and useful to a user, but not perfectly unamb...