File indexing completed on 2026-05-10 08:44:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_OBJECT_TAPIFILE_H
0014 #define LLVM_OBJECT_TAPIFILE_H
0015
0016 #include "llvm/ADT/StringRef.h"
0017 #include "llvm/Object/Binary.h"
0018 #include "llvm/Object/ObjectFile.h"
0019 #include "llvm/Object/SymbolicFile.h"
0020 #include "llvm/Support/Error.h"
0021 #include "llvm/Support/MemoryBufferRef.h"
0022 #include "llvm/TextAPI/Architecture.h"
0023 #include "llvm/TextAPI/InterfaceFile.h"
0024
0025 namespace llvm {
0026
0027 class raw_ostream;
0028
0029 namespace object {
0030
0031 class TapiFile : public SymbolicFile {
0032 public:
0033 TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &Interface,
0034 MachO::Architecture Arch);
0035 ~TapiFile() override;
0036
0037 void moveSymbolNext(DataRefImpl &DRI) const override;
0038
0039 Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override;
0040
0041 Expected<uint32_t> getSymbolFlags(DataRefImpl DRI) const override;
0042
0043 basic_symbol_iterator symbol_begin() const override;
0044
0045 basic_symbol_iterator symbol_end() const override;
0046
0047 Expected<SymbolRef::Type> getSymbolType(DataRefImpl DRI) const;
0048
0049 bool hasSegmentInfo() { return FileKind >= MachO::FileType::TBD_V5; }
0050
0051 static bool classof(const Binary *v) { return v->isTapiFile(); }
0052
0053 bool is64Bit() const override { return MachO::is64Bit(Arch); }
0054
0055 private:
0056 struct Symbol {
0057 StringRef Prefix;
0058 StringRef Name;
0059 uint32_t Flags;
0060 SymbolRef::Type Type;
0061
0062 constexpr Symbol(StringRef Prefix, StringRef Name, uint32_t Flags,
0063 SymbolRef::Type Type)
0064 : Prefix(Prefix), Name(Name), Flags(Flags), Type(Type) {}
0065 };
0066
0067 std::vector<Symbol> Symbols;
0068 MachO::Architecture Arch;
0069 MachO::FileType FileKind;
0070 };
0071
0072 }
0073 }
0074
0075 #endif