LLVM 22.0.0git
TapiFile.h
Go to the documentation of this file.
1//===- TapiFile.h - Text-based Dynamic Library Stub -------------*- 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// This file declares the TapiFile interface.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_OBJECT_TAPIFILE_H
14#define LLVM_OBJECT_TAPIFILE_H
15
16#include "llvm/ADT/StringRef.h"
17#include "llvm/Object/Binary.h"
21#include "llvm/Support/Error.h"
25
26namespace llvm {
27
28class raw_ostream;
29
30namespace object {
31
33public:
34 TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &Interface,
36 ~TapiFile() override;
37
38 void moveSymbolNext(DataRefImpl &DRI) const override;
39
40 Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override;
41
42 Expected<uint32_t> getSymbolFlags(DataRefImpl DRI) const override;
43
44 basic_symbol_iterator symbol_begin() const override;
45
46 basic_symbol_iterator symbol_end() const override;
47
49
50 bool hasSegmentInfo() { return FileKind >= MachO::FileType::TBD_V5; }
51
52 static bool classof(const Binary *v) { return v->isTapiFile(); }
53
54 bool is64Bit() const override { return MachO::is64Bit(Arch); }
55
56private:
57 struct Symbol {
58 StringRef Prefix;
60 uint32_t Flags;
62
63 constexpr Symbol(StringRef Prefix, StringRef Name, uint32_t Flags,
65 : Prefix(Prefix), Name(Name), Flags(Flags), Type(Type) {}
66 };
67
68 std::vector<Symbol> Symbols;
69 MachO::Architecture Arch;
70 MachO::FileType FileKind;
71};
72
73} // end namespace object.
74} // end namespace llvm.
75
76#endif // LLVM_OBJECT_TAPIFILE_H
RelocType Type
Definition: COFFYAML.cpp:410
#define LLVM_ABI
Definition: Compiler.h:213
std::string Name
raw_pwrite_stream & OS
static std::unique_ptr< PDBSymbol > getSymbolType(const PDBSymbol &Symbol)
Definition: UDTLayout.cpp:35
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
Tagged union holding either a T or a Error.
Definition: Error.h:485
Defines the interface file.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
static bool classof(const Binary *v)
Definition: TapiFile.h:52
bool is64Bit() const override
Definition: TapiFile.h:54
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:28
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18