15 static struct RegisterJIT {
29 assert(F &&
"Function *F was null at entry to run()");
32 assert(FPtr &&
"Pointer to fn's code was null after getPointerToFunction");
38 "Wrong number of arguments passed into function!");
40 "This doesn't support passing arguments through varargs (yet)!");
45 switch (ArgValues.
size()) {
50 int (*PF)(int,
char **,
const char **) =
51 (
int (*)(int,
char **,
const char **))(
intptr_t)FPtr;
56 (
char **)
GVTOP(ArgValues[1]),
57 (
const char **)
GVTOP(ArgValues[2])));
64 int (*PF)(int,
char **) = (
int (*)(int,
char **))(
intptr_t)FPtr;
69 (
char **)
GVTOP(ArgValues[1])));
76 int (*PF)(int) = (
int (*)(int))(
intptr_t)FPtr;
85 if (ArgValues.
empty()) {
91 unsigned BitWidth = cast<IntegerType>(RetTy)->
getBitWidth();
94 else if (BitWidth <= 8)
96 else if (BitWidth <= 16)
98 else if (BitWidth <= 32)
100 else if (BitWidth <= 64)
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type (if unknown returns 0).
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
2: 32-bit floating point type
4: 80-bit floating point type (X87)
Class to represent function types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TypeID getTypeID() const
Return the type id for the type.
size_t size() const
size - Get the array size.
11: Arbitrary bit width integers
GenericValue runFunction(Function *F, ArrayRef< GenericValue > ArgValues) override
runFunction - Execute the specified function with the specified arguments, and return the result...
Type * getParamType(unsigned i) const
Parameter type accessors.
The instances of the Type class are immutable: once they are created, they are never changed...
void LLVMLinkInOrcMCJITReplacement()
6: 128-bit floating point type (two 64-bits, PowerPC)
bool empty() const
empty - Check if the array is empty.
bool isPointerTy() const
True if this is an instance of PointerType.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void * getPointerToFunction(Function *F) override
getPointerToFunction - The different EE's represent function bodies in different ways.
void * GVTOP(const GenericValue &GV)
GenericValue PTOGV(void *P)
Class for arbitrary precision integers.
bool isIntegerTy() const
True if this is an instance of IntegerType.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
3: 64-bit floating point type
Type * getReturnType() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isVoidTy() const
Return true if this is 'void'.
5: 128-bit floating point type (112-bit mantissa)