An high view of a symbol.
More...
#include <Symbol.h>
|
bool | isGlobal () const noexcept |
| Returns the visibility of the symbol.
|
|
bool | isDefined () const noexcept |
| Returns the definedness of the symbol.
|
|
size_t | getReferences () const noexcept |
| Counts how many times this symbol is referenced.
|
|
std::optional< llvm::StringRef > | getOverwriteName () const noexcept |
| Returns the overwrite name.
|
|
bool | isMachO () const noexcept |
| Returns true if the symbol contains references to some mach-o symbols.
|
|
void | setName (std::string Name) noexcept |
| Sets the name of the symbol.
|
|
void | updateWithNewSymbolInfo (const SymbolInfo &Syminfo) noexcept |
| Updates the symbol with new symbol information.
|
|
| Symbol () noexcept |
| Constructs a new symbol.
|
|
| Symbol (const Symbol &) noexcept=delete |
|
| Symbol (Symbol &&) noexcept=default |
|
Symbol & | operator= (const Symbol &) noexcept=delete |
|
Symbol & | operator= (Symbol &&) noexcept=default |
|
An high view of a symbol.
◆ Symbol()
BARTLEBY_API Symbol::Symbol |
( |
| ) |
|
|
noexcept |
◆ getOverwriteName()
BARTLEBY_API std::optional< llvm::StringRef > Symbol::getOverwriteName |
( |
| ) |
const |
|
noexcept |
Returns the overwrite name.
- Returns
- The overwrite name.
65 {
66 return OverwriteName;
67}
◆ getReferences()
size_t saq::bartleby::Symbol::getReferences |
( |
| ) |
const |
|
noexcept |
Counts how many times this symbol is referenced.
- Returns
- Number of references.
◆ isDefined()
BARTLEBY_API bool Symbol::isDefined |
( |
| ) |
const |
|
noexcept |
Returns the definedness of the symbol.
- Returns
- True if symbol is defined, else false.
◆ isGlobal()
BARTLEBY_API bool Symbol::isGlobal |
( |
| ) |
const |
|
noexcept |
Returns the visibility of the symbol.
- Returns
- True if symbol is global, else false.
◆ isMachO()
bool Symbol::isMachO |
( |
| ) |
const |
|
noexcept |
Returns true if the symbol contains references to some mach-o symbols.
- Returns
- True if the symbol contains references to some mach-o, else false.
52 {
53 return Type == llvm::Triple::ObjectFormatType::MachO;
54}
◆ setName()
BARTLEBY_API void Symbol::setName |
( |
std::string |
Name | ) |
|
|
noexcept |
Sets the name of the symbol.
- Parameters
-
56 {
57 OverwriteName = Name;
58}
◆ updateWithNewSymbolInfo()
void Symbol::updateWithNewSymbolInfo |
( |
const SymbolInfo & |
Syminfo | ) |
|
|
noexcept |
Updates the symbol with new symbol information.
- Parameters
-
35 {
36 assert(SymInfo.Err == false);
37
38 if ((*SymInfo.Flags & llvm::object::BasicSymbolRef::Flags::SF_Weak) == 0) {
39 if ((*SymInfo.Flags & llvm::object::BasicSymbolRef::Flags::SF_Undefined) ==
40 0) {
41 LLVM_DEBUG(llvm::errs() << "symbol is defined. marked as defined\n");
42 Defined = true;
43 }
44 if (*SymInfo.Flags & llvm::object::BasicSymbolRef::Flags::SF_Global) {
45 LLVM_DEBUG(llvm::errs() << "symbol is global. marked as defined\n");
46 Global = true;
47 }
48 }
49 Type = SymInfo.ObjectType;
50}
The documentation for this class was generated from the following files: