1 //===- TapiFile.h - Text-based Dynamic Library Stub -------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares the TapiFile interface.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_OBJECT_TAPIFILE_H
14 #define LLVM_OBJECT_TAPIFILE_H
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/Object/Binary.h"
18 #include "llvm/Object/SymbolicFile.h"
19 #include "llvm/Support/Error.h"
20 #include "llvm/Support/MemoryBufferRef.h"
21 #include "llvm/TextAPI/Architecture.h"
35 class TapiFile : public SymbolicFile {
37 TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &interface,
38 MachO::Architecture Arch);
41 void moveSymbolNext(DataRefImpl &DRI) const override;
43 Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override;
45 Expected<uint32_t> getSymbolFlags(DataRefImpl DRI) const override;
47 basic_symbol_iterator symbol_begin() const override;
49 basic_symbol_iterator symbol_end() const override;
51 static bool classof(const Binary *v) { return v->isTapiFile(); }
53 bool is64Bit() { return MachO::is64Bit(Arch); }
61 constexpr Symbol(StringRef Prefix, StringRef Name, uint32_t Flags)
62 : Prefix(Prefix), Name(Name), Flags(Flags) {}
65 std::vector<Symbol> Symbols;
66 MachO::Architecture Arch;
69 } // end namespace object.
70 } // end namespace llvm.
72 #endif // LLVM_OBJECT_TAPIFILE_H