9#ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
10#define LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
30class RuntimeDyldCheckerImpl;
89 TargetAddress(TargetAddress), TargetFlags(TargetFlags) {}
93 : Size(Size), TargetAddress(TargetAddress) {}
97 assert(Size &&
"setContent/setZeroFill must be called first");
103 assert(!ContentPtr && !Size &&
"Content/zero-fill already set");
110 assert(!ContentPtr && !this->Size &&
"Content/zero-fill already set");
117 return {ContentPtr,
static_cast<size_t>(Size)};
128 assert(!this->TargetAddress &&
"TargetAddress already set");
129 this->TargetAddress = TargetAddress;
140 assert(Flags <= 1 &&
"Add more bits to store more than one flag");
145 const char *ContentPtr =
nullptr;
153 std::function<Expected<MemoryRegionInfo>(
StringRef SymbolName)>;
194 std::unique_ptr<RuntimeDyldCheckerImpl> Impl;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This interface provides simple read-only access to a block of memory, and provides simple methods for...
void setContent(ArrayRef< char > Content)
Set the content for this memory region.
void setZeroFill(uint64_t Size)
Set a zero-fill length for this memory region.
void setTargetFlags(TargetFlagsType Flags)
Set the target flags for this Symbol.
JITTargetAddress getTargetAddress() const
Return the target address for this region.
MemoryRegionInfo()=default
MemoryRegionInfo(ArrayRef< char > Content, JITTargetAddress TargetAddress, TargetFlagsType TargetFlags)
Constructor for symbols/sections with content and TargetFlag.
void setTargetAddress(JITTargetAddress TargetAddress)
Set the target address for this region.
ArrayRef< char > getContent() const
Returns the content for this section if there is any.
uint64_t getZeroFillLength() const
Returns the zero-fill length for this section.
MemoryRegionInfo(uint64_t Size, JITTargetAddress TargetAddress)
Constructor for zero-fill symbols/sections.
TargetFlagsType getTargetFlags() const
Get the target flags for this Symbol.
bool isZeroFill() const
Returns true if this is a zero-fill symbol/section.
RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations.
std::pair< uint64_t, std::string > getSectionAddr(StringRef FileName, StringRef SectionName, bool LocalAddress)
Returns the address of the requested section (or an error message in the second element of the pair i...
bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const
Scan the given memory buffer for lines beginning with the string in RulePrefix.
bool check(StringRef CheckExpr) const
Check a single expression against the attached RuntimeDyld instance.
std::function< bool(StringRef Symbol)> IsSymbolValidFunction
std::optional< uint64_t > getSectionLoadAddress(void *LocalAddress) const
If there is a section at the given local address, return its load address, otherwise return std::null...
std::function< Expected< MemoryRegionInfo >(StringRef StubContainer, StringRef TargetName, StringRef StubKindFilter)> GetStubInfoFunction
std::function< Expected< MemoryRegionInfo >(StringRef FileName, StringRef SectionName)> GetSectionInfoFunction
std::function< Expected< MemoryRegionInfo >(StringRef GOTContainer, StringRef TargetName)> GetGOTInfoFunction
std::function< Expected< MemoryRegionInfo >(StringRef SymbolName)> GetSymbolInfoFunction
StringRef - Represent a constant reference to a string, i.e.
Manages the enabling and disabling of subtarget specific features.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
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.
uint8_t TargetFlagsType
Holds target-specific properties for a symbol.