| 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_LIB_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTERIMPL_H |
| 10 | #define LLVM_LIB_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTERIMPL_H |
| 11 | |
| 12 | #include "llvm/ADT/ArrayRef.h" |
| 13 | #include "llvm/ADT/STLFunctionalExtras.h" |
| 14 | #include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h" |
| 15 | |
| 16 | namespace llvm { |
| 17 | |
| 18 | struct DIDumpOptions; |
| 19 | class raw_ostream; |
| 20 | |
| 21 | namespace detail { |
| 22 | |
| 23 | /// Prints the base type DIE that operand \p Operand of \p Operands refers to. |
| 24 | /// A callback, so that printing without a DWARFUnit does not link DWARFUnit. |
| 25 | using BaseTypeRefPrinter = |
| 26 | function_ref<void(raw_ostream &OS, DIDumpOptions DumpOpts, |
| 27 | ArrayRef<uint64_t> Operands, unsigned Operand)>; |
| 28 | |
| 29 | void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS, |
| 30 | DIDumpOptions DumpOpts, |
| 31 | BaseTypeRefPrinter PrintBaseTypeRef, bool IsEH); |
| 32 | |
| 33 | bool prettyPrintRegisterOp(BaseTypeRefPrinter PrintBaseTypeRef, raw_ostream &OS, |
| 34 | DIDumpOptions DumpOpts, uint8_t Opcode, |
| 35 | ArrayRef<uint64_t> Operands); |
| 36 | |
| 37 | } // namespace detail |
| 38 | } // namespace llvm |
| 39 | |
| 40 | #endif // LLVM_LIB_DEBUGINFO_DWARF_DWARFEXPRESSIONPRINTERIMPL_H |
| 41 | |