LLVM 24.0.0git
DWARFExpressionPrinter.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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// DWARFUnit is intentionally not forward-declared here: the printers in this
20// header must not depend on DWARFUnit, so that users of them do not link
21// DWARFUnit and DWARFContext. Printers that resolve base type references
22// through a DWARFUnit live in DWARFExpressionUnit.h.
23struct DIDumpOptions;
24class raw_ostream;
25
26/// Print a Dwarf expression. Base type references are printed as raw offsets.
27/// \param E to be printed
28/// \param OS to this stream
29/// \param DumpOpts with these options
31 DIDumpOptions DumpOpts, bool IsEH = false);
32
33/// Print the expression in a format intended to be compact and useful to a
34/// user, but not perfectly unambiguous, or capable of representing every
35/// valid DWARF expression. Returns true if the expression was sucessfully
36/// printed.
37///
38/// \param E to be printed
39/// \param OS to this stream
40/// \param GetNameForDWARFReg side-effect-free callback to return a target
41/// register name, or an empty string if none is available. The printer may try
42/// another name-resolution method before reporting failure.
43///
44/// \returns true if the expression was successfully printed
46 const DWARFExpression *E, raw_ostream &OS,
47 std::function<StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg =
48 nullptr);
49
50} // end namespace llvm
51
52#endif // LLVM_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTER_H
uint64_t uint64_t
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:211
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS, DIDumpOptions DumpOpts, bool IsEH=false)
Print a Dwarf expression.
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...
Container for dump options that control which debug information will be dumped.
Definition DIContext.h:197