9#include <unordered_set>
28 std::vector<uint8_t>
UUID;
29 if (
auto *MachO = dyn_cast<object::MachOObjectFile>(&Obj)) {
31 if (!MachUUID.
empty())
33 }
else if (isa<object::ELFObjectFileBase>(&Obj)) {
34 const StringRef GNUBuildID(
".note.gnu.build-id");
42 if (SectName != GNUBuildID)
61 if (!UUIDBytes.
empty()) {
62 auto Ptr =
reinterpret_cast<const uint8_t *
>(UUIDBytes.
data());
76 const bool IsMachO = isa<MachOObjectFile>(&Obj);
77 const bool IsELF = isa<ELFObjectFileBase>(&Obj);
95 if (SymType.
get() != SymbolRef::Type::ST_Function ||
99 constexpr bool NoCopy =
false;
105 "ObjectFileTransformer: ");
113 Name->consume_front(
"_");
119 *Out.
GetOS() <<
"Loaded " << FunctionsAddedCount
120 <<
" 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).
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.
void addFunctionInfo(FunctionInfo &&FI)
Add a function info to this GSYM creator.
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.
size_t getNumFunctionInfos() const
Get the current number of FunctionInfo objects contained in this object.
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.
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.