Go to the documentation of this file.
11 #include "llvm/Config/config.h"
21 #define DEBUG_TYPE "orc"
30 #if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \
31 !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
53 static void((*RegisterFrame)(
const void *)) = 0;
56 *(
void **)&RegisterFrame =
64 return make_error<StringError>(
"could not register eh-frame: "
65 "__register_frame function not found",
70 static void((*DeregisterFrame)(
const void *)) = 0;
73 *(
void **)&DeregisterFrame =
75 "__deregister_frame");
77 if (DeregisterFrame) {
82 return make_error<StringError>(
"could not deregister eh-frame: "
83 "__deregister_frame function not found",
88 #if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
90 template <
typename HandleFDEFn>
91 Error walkLibunwindEHFrameSection(
const char *
const SectionStart,
93 const char *CurCFIRecord = SectionStart;
97 while (CurCFIRecord != End && Size != 0) {
98 const char *OffsetField = CurCFIRecord + (
Size == 0xffffffff ? 12 : 4);
99 if (Size == 0xffffffff)
100 Size = *
reinterpret_cast<const uint64_t *
>(CurCFIRecord + 4) + 12;
106 dbgs() <<
"Registering eh-frame section:\n";
107 dbgs() <<
"Processing " << (
Offset ?
"FDE" :
"CIE") <<
" @"
108 << (
void *)CurCFIRecord <<
": [";
109 for (
unsigned I = 0;
I <
Size; ++
I)
110 dbgs() <<
format(
" 0x%02" PRIx8, *(CurCFIRecord +
I));
115 if (
auto Err = HandleFDE(CurCFIRecord))
118 CurCFIRecord +=
Size;
120 Size = *
reinterpret_cast<const uint32_t *
>(CurCFIRecord);
126 #endif // HAVE_UNW_ADD_DYNAMIC_FDE || __APPLE__
129 size_t EHFrameSectionSize) {
132 #if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
134 return walkLibunwindEHFrameSection(
135 static_cast<const char *
>(EHFrameSectionAddr), EHFrameSectionSize,
148 size_t EHFrameSectionSize) {
149 #if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
150 return walkLibunwindEHFrameSection(
151 static_cast<const char *
>(EHFrameSectionAddr), EHFrameSectionSize,
This is an optimization pass for GlobalISel generic memory operations.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
static ErrorSuccess success()
Create a success value.
std::enable_if_t< std::is_pointer< T >::value, T > toPtr() const
Cast this ExecutorAddr to a pointer of the given type.
Error deregisterEHFrameSection(const void *EHFrameSectionAddr, size_t EHFrameSectionSize)
Unregister frames in the given eh-frame section with libunwind.
then ret i32 result Tail recursion elimination should handle
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void __deregister_frame(const void *)
Represents an address range in the exceutor process.
static void * SearchForAddressOfSymbol(const char *symbolName)
This function will search through all previously loaded dynamic libraries for the symbol symbolName.
ExecutorAddrDiff size() const
orc::shared::CWrapperFunctionResult llvm_orc_registerEHFrameSectionWrapper(const char *Data, uint64_t Size)
static Error registerEHFrameWrapper(ExecutorAddrRange EHFrame)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Lightweight error class with error context and mandatory checking.
orc::shared::CWrapperFunctionResult llvm_orc_deregisterEHFrameSectionWrapper(const char *Data, uint64_t Size)
static Error deregisterEHFrameWrapper(ExecutorAddrRange EHFrame)
Error registerEHFrameSection(const void *EHFrameSectionAddr, size_t EHFrameSectionSize)
Register frames in the given eh-frame section with libunwind.
Error deregisterFrameWrapper(const void *P)
void __register_frame(const void *)
Error registerFrameWrapper(const void *P)