9#ifndef LLVM_DEBUGINFO_GSYM_GSYMCREATOR_H
10#define LLVM_DEBUGINFO_GSYM_GSYMCREATOR_H
32class OutputAggregator;
137 mutable std::mutex
Mutex;
138 std::vector<FunctionInfo> Funcs;
144 std::vector<llvm::gsym::FileEntry> Files;
145 std::vector<uint8_t>
UUID;
146 std::optional<AddressRanges> ValidTextRanges;
147 std::optional<uint64_t> BaseAddress;
148 bool IsSegment =
false;
149 bool Finalized =
false;
157 std::optional<uint64_t> getFirstFunctionAddress()
const;
163 std::optional<uint64_t> getLastFunctionAddress()
const;
170 std::optional<uint64_t> getBaseAddress()
const;
180 uint8_t getAddressOffsetSize()
const;
190 uint64_t getMaxAddressOffset()
const;
205 uint64_t calculateHeaderAndTableSize()
const;
291 void setIsSegment() {
314 std::optional<uint64_t> SegmentSize = std::nullopt)
const;
415 std::function<
bool(
const FunctionInfo &)>
const &Callback)
const;
423 ValidTextRanges = TextRanges;
428 return ValidTextRanges;
uint64_t IntrinsicInst * II
StringSet - A set-like wrapper for the StringMap.
std::pair< llvm::MachO::Target, std::string > UUID
The AddressRanges class helps normalize address range collections.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
StringSet - A wrapper for StringMap that provides set-like functionality.
Utility for building string tables with deduplicated suffixes.
A simplified binary data writer class that doesn't require targets, target definitions,...
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 setBaseAddress(uint64_t Addr)
Set the base address to use for the GSYM file.
const std::optional< AddressRanges > GetValidTextRanges() const
Get the valid text ranges.
LLVM_ABI llvm::Expected< std::unique_ptr< GsymCreator > > createSegment(uint64_t SegmentSize, size_t &FuncIdx) const
Create a segmented GSYM creator starting with function info index FuncIdx.
LLVM_ABI llvm::Error save(StringRef Path, llvm::endianness ByteOrder, std::optional< uint64_t > SegmentSize=std::nullopt) const
Save a GSYM file to a stand alone file.
LLVM_ABI void prepareMergedFunctions(OutputAggregator &Out)
Organize merged FunctionInfo's.
LLVM_ABI StringRef getString(uint32_t Offset)
Retrieve a string from the GSYM string table given its offset.
LLVM_ABI llvm::Error loadCallSitesFromYAML(StringRef YAMLFile)
Load call site information from a YAML file.
LLVM_ABI llvm::Error encode(FileWriter &O) const
Encode a GSYM into the file writer stream at the current position.
bool isQuiet() const
Whether the transformation should be quiet, i.e. not output warnings.
void setUUID(llvm::ArrayRef< uint8_t > UUIDBytes)
Set the UUID value.
void SetValidTextRanges(AddressRanges &TextRanges)
Set valid .text address ranges that all functions must be contained in.
LLVM_ABI uint32_t insertFile(StringRef Path, sys::path::Style Style=sys::path::Style::native)
Insert a file into this GSYM creator.
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.
LLVM_ABI void forEachFunctionInfo(std::function< bool(FunctionInfo &)> const &Callback)
Thread safe iteration over all function infos.
This is an optimization pass for GlobalISel generic memory operations.
Files in GSYM are contained in FileEntry structs where we split the directory and basename into two d...
Function information in GSYM files encodes information for one contiguous address range.
Inline information stores the name of the inline function along with an array of address ranges.