xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/XCOFFDump.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 //===-- XCOFFDump.h ---------------------------------------------*- 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_TOOLS_LLVM_OBJDUMP_XCOFFDUMP_H
10 #define LLVM_TOOLS_LLVM_OBJDUMP_XCOFFDUMP_H
11 
12 #include "llvm/Object/XCOFFObjectFile.h"
13 
14 namespace llvm {
15 
16 class formatted_raw_ostream;
17 class MCSubtargetInfo;
18 struct SymbolInfoTy;
19 
20 namespace objdump {
21 std::optional<XCOFF::StorageMappingClass>
22 getXCOFFSymbolCsectSMC(const object::XCOFFObjectFile &Obj,
23                        const object::SymbolRef &Sym);
24 
25 std::optional<object::SymbolRef>
26 getXCOFFSymbolContainingSymbolRef(const object::XCOFFObjectFile &Obj,
27                                   const object::SymbolRef &Sym);
28 
29 bool isLabel(const object::XCOFFObjectFile &Obj, const object::SymbolRef &Sym);
30 
31 std::string getXCOFFSymbolDescription(const SymbolInfoTy &SymbolInfo,
32                                       StringRef SymbolName);
33 
34 Error getXCOFFRelocationValueString(const object::XCOFFObjectFile &Obj,
35                                     const object::RelocationRef &RelRef,
36                                     llvm::SmallVectorImpl<char> &Result);
37 
38 void dumpTracebackTable(ArrayRef<uint8_t> Bytes, uint64_t Address,
39                         formatted_raw_ostream &OS, uint64_t End,
40                         const MCSubtargetInfo &STI,
41                         const object::XCOFFObjectFile *Obj);
42 } // namespace objdump
43 } // namespace llvm
44 #endif
45