Displaying 4 results from an estimated 4 matches for "thepointer".
2009 Mar 08
2
[LLVMdev] Creating Pointer Constants
...I am writing a JIT compiler for a subset of the Matlab language and as a
part of my implementation, I would like to be able to pass a constant
pointer to a native function I'm calling.
Right now, this is what I do:
llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty,
(int64)thePointer);
llvm::Value* constPtr = llvm::ConstantExpr::getIntToPtr(constInt,
llvm::PointerType::getUnqual(llvm::Type::Int32Ty));
builder.CreateCall(my_function, constPtr);
The resulting IR call looks like this:
call void @nativeFunc(i32* inttoptr (i64 146876396 to i32*))
I'm just wondering if there...
2010 Jan 06
0
[LLVMdev] [Help] How can we call an object's virtual function inside IR?
Hi Gyounghwa Kim,
> First of all, thank you very much for your answer.
> I tried your sugestion and found out that it is not what I wanted.
> What I have to do is call a native C function from inside this
> generated function.
> Is there any way that we can find and call native C functions not
> created by LLVM IR?
You can insert a declaration of the function into the IR, then
2010 Jan 05
5
[LLVMdev] [Help] How can we call an object's virtual function inside IR?
Dear experts,
I am learning llvm by reading documents and have a question to ask.
The following is the example of code generation that I created.
[[a [10.00]] > [3.00]]
; ModuleID = 'ExprF'
define i1 @expr(double* %record) {
entry:
%0 = getelementptr double* %record, i32 0 ;
<double*> [#uses=1]
%1 = load double* %0 ; <double>
2009 Mar 11
0
[LLVMdev] Creating Pointer Constants
...t of the Matlab language and
> as a
> part of my implementation, I would like to be able to pass a constant
> pointer to a native function I'm calling.
>
> Right now, this is what I do:
>
> llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty,
> (int64)thePointer);
> llvm::Value* constPtr = llvm::ConstantExpr::getIntToPtr(constInt,
> llvm::PointerType::getUnqual(llvm::Type::Int32Ty));
>
> builder.CreateCall(my_function, constPtr);
>
> The resulting IR call looks like this:
>
> call void @nativeFunc(i32* inttoptr (i64 146876396 to i...