26 std::vector<uint8_t>
UUID;
27 if (
auto *MachO = dyn_cast<object::MachOObjectFile>(&Obj)) {
29 if (!MachUUID.
empty())
31 }
else if (isa<object::ELFObjectFileBase>(&Obj)) {
32 const StringRef GNUBuildID(
".note.gnu.build-id");
40 if (SectName != GNUBuildID)
59 if (!UUIDBytes.
empty()) {
74 const bool IsMachO = isa<MachOObjectFile>(&Obj);
75 const bool IsELF = isa<ELFObjectFileBase>(&Obj);
93 if (SymType.
get() != SymbolRef::Type::ST_Function ||
97 constexpr bool NoCopy =
false;
103 "ObjectFileTransformer: ");
111 Name->consume_front(
"_");
117 *Out.
GetOS() <<
"Loaded " << FunctionsAddedCount
118 <<
" functions from symbol table.\n";
std::pair< llvm::MachO::Target, std::string > UUID
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
LLVM_ABI bool isLittleEndian() const
Tests whether the target triple is little endian.
GsymCreator is used to emit GSYM data to a stand alone file or section within a file.
LLVM_ABI void addFunctionInfo(FunctionInfo &&FI)
Add a function info to this GSYM creator.
LLVM_ABI uint32_t insertString(StringRef S, bool Copy=true)
Insert a string into the GSYM string table.
void setUUID(llvm::ArrayRef< uint8_t > UUIDBytes)
Set the UUID value.
LLVM_ABI size_t getNumFunctionInfos() const
Get the current number of FunctionInfo objects contained in this object.
LLVM_ABI bool IsValidTextAddress(uint64_t Addr) const
Check if an address is a valid code address.
raw_ostream * GetOS() const
This class is the base class for all object file types.
Triple makeTriple() const
Create a triple from the data in this object file.
section_iterator_range sections() const
symbol_iterator_range symbols() const
This is a value type class that represents a single section in the list of sections in the object fil...
This is a value type class that represents a single symbol in the list of symbols in the object file.
constexpr size_t NameSize
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner={})
Log all errors (if any) in E to OS.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
void consumeError(Error Err)
Consume a Error without doing anything.
Function information in GSYM files encodes information for one contiguous address range.