LLVM  14.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"
19 #include "llvm/Support/Error.h"
22 
23 namespace llvm {
24 namespace object {
25 
26 class TapiFile : public SymbolicFile {
27 public:
29  MachO::Architecture Arch);
30  ~TapiFile() override;
31 
32  void moveSymbolNext(DataRefImpl &DRI) const override;
33 
34  Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override;
35 
36  Expected<uint32_t> getSymbolFlags(DataRefImpl DRI) const override;
37 
38  basic_symbol_iterator symbol_begin() const override;
39 
40  basic_symbol_iterator symbol_end() const override;
41 
42  static bool classof(const Binary *v) { return v->isTapiFile(); }
43 
44  bool is64Bit() { return MachO::is64Bit(Arch); }
45 
46 private:
47  struct Symbol {
50  uint32_t Flags;
51 
52  constexpr Symbol(StringRef Prefix, StringRef Name, uint32_t Flags)
53  : Prefix(Prefix), Name(Name), Flags(Flags) {}
54  };
55 
56  std::vector<Symbol> Symbols;
58 };
59 
60 } // end namespace object.
61 } // end namespace llvm.
62 
63 #endif // LLVM_OBJECT_TAPIFILE_H
llvm::MachO::is64Bit
bool is64Bit(Architecture)
Check if architecture is 64 bit.
Definition: Architecture.cpp:78
MemoryBuffer.h
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::object::TapiFile::moveSymbolNext
void moveSymbolNext(DataRefImpl &DRI) const override
Definition: TapiFile.cpp:73
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:164
StringRef.h
Error.h
llvm::object::TapiFile::getSymbolFlags
Expected< uint32_t > getSymbolFlags(DataRefImpl DRI) const override
Definition: TapiFile.cpp:82
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
SymbolicFile.h
llvm::MemoryBufferRef
Definition: MemoryBufferRef.h:22
llvm::object::TapiFile::~TapiFile
~TapiFile() override
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::object::TapiFile::printSymbolName
Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override
Definition: TapiFile.cpp:75
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
llvm::MachO::Architecture
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:27
llvm::object::TapiFile::classof
static bool classof(const Binary *v)
Definition: TapiFile.h:42
llvm::MachO::InterfaceFile
Defines the interface file.
Definition: InterfaceFile.h:156
llvm::object::content_iterator
Definition: SymbolicFile.h:67
iterator_range.h
llvm::object::TapiFile::symbol_begin
basic_symbol_iterator symbol_begin() const override
Definition: TapiFile.cpp:87
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:100
llvm::object::TapiFile::TapiFile
TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &interface, MachO::Architecture Arch)
Definition: TapiFile.cpp:36
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::object::Binary
Definition: Binary.h:32
uint32_t
llvm::object::DataRefImpl
Definition: SymbolicFile.h:33
llvm::object::TapiFile::is64Bit
bool is64Bit()
Definition: TapiFile.h:44
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::object::TapiFile
Definition: TapiFile.h:26
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::object::TapiFile::symbol_end
basic_symbol_iterator symbol_end() const override
Definition: TapiFile.cpp:93
llvm::object::SymbolicFile
Definition: SymbolicFile.h:143
InterfaceFile.h
llvm::object::Binary::isTapiFile
bool isTapiFile() const
Definition: Binary.h:146