LLVM  10.0.0svn
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_TAPI_FILE_H
14 #define LLVM_OBJECT_TAPI_FILE_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  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 private:
45  struct Symbol {
48  uint32_t Flags;
49 
50  constexpr Symbol(StringRef Prefix, StringRef Name, uint32_t Flags)
51  : Prefix(Prefix), Name(Name), Flags(Flags) {}
52  };
53 
54  std::vector<Symbol> Symbols;
55 };
56 
57 } // end namespace object.
58 } // end namespace llvm.
59 
60 #endif // LLVM_OBJECT_TAPI_FILE_H
Defines the interface file.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
basic_symbol_iterator symbol_begin() const override
Definition: TapiFile.cpp:94
void moveSymbolNext(DataRefImpl &DRI) const override
Definition: TapiFile.cpp:78
bool isTapiFile() const
Definition: Binary.h:144
static bool classof(const Binary *v)
Definition: TapiFile.h:42
basic_symbol_iterator symbol_end() const override
Definition: TapiFile.cpp:100
TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &interface, MachO::Architecture Arch)
Definition: TapiFile.cpp:41
Error printSymbolName(raw_ostream &OS, DataRefImpl DRI) const override
Definition: TapiFile.cpp:83
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:24
uint32_t getSymbolFlags(DataRefImpl DRI) const override
Definition: TapiFile.cpp:89
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48