23#include "llvm/Object/ObjectFile.h"
27namespace saq::bartleby {
32 llvm::object::SymbolRef
Sym;
35 std::optional<llvm::object::SymbolRef::Type>
Type;
41 std::optional<llvm::StringRef>
Name;
45 llvm::Triple::ObjectFormatType::UnknownObjectFormat;
57 [[nodiscard]]
bool isGlobal()
const noexcept;
62 [[nodiscard]]
bool isDefined()
const noexcept;
72 [[nodiscard]] std::optional<llvm::StringRef>
80 [[nodiscard]]
bool isMachO() const noexcept;
85 void setName(std::
string Name) noexcept;
99 ~
Symbol() noexcept = default;
103 std::optional<std::
string> OverwriteName;
106 llvm::Triple::ObjectFormatType Type =
107 llvm::Triple::ObjectFormatType::UnknownObjectFormat;
113 bool Defined = false;
An high view of a symbol.
Definition: Symbol.h:52
size_t getReferences() const noexcept
Counts how many times this symbol is referenced.
std::optional< llvm::StringRef > getOverwriteName() const noexcept
Returns the overwrite name.
Definition: Symbol.cpp:65
void setName(std::string Name) noexcept
Sets the name of the symbol.
Definition: Symbol.cpp:56
bool isGlobal() const noexcept
Returns the visibility of the symbol.
Definition: Symbol.cpp:60
void updateWithNewSymbolInfo(const SymbolInfo &Syminfo) noexcept
Updates the symbol with new symbol information.
Definition: Symbol.cpp:35
bool isMachO() const noexcept
Returns true if the symbol contains references to some mach-o symbols.
Definition: Symbol.cpp:52
bool isDefined() const noexcept
Returns the definedness of the symbol.
Definition: Symbol.cpp:62
Various information about a symbol.
Definition: Symbol.h:30
std::optional< llvm::StringRef > Name
Its name.
Definition: Symbol.h:41
bool Err
An error occurred.
Definition: Symbol.h:48
std::optional< uint32_t > Flags
Its flags.
Definition: Symbol.h:38
std::optional< llvm::object::SymbolRef::Type > Type
Its type.
Definition: Symbol.h:35
llvm::Triple::ObjectFormatType ObjectType
Type of the object it belongs to.
Definition: Symbol.h:44
llvm::object::SymbolRef Sym
The symbol.
Definition: Symbol.h:32