Displaying 20 results from an estimated 3000 matches similar to: "How to pass arbitrary arguments to runFunctionAsMain?"
2019 Mar 09
2
Cast a function parameter to GEP
Hi all,
I'm still working on the Interpreter class and I would like to understand
why an operand cannot be cast to GetElementPtrInst.
My code is something like:
void MyInterpreter::visitCallInst(CallInst& I)
{
for(int i = 0; i < I.getNumArgOperands(); i++) {
operand = I.getOperand(i);
if(GetElementPtrInst* CI =
dyn_cast<GetElementPtrInst>(operand)) {
2020 Jan 03
3
Interpreter crash due to an "Unknown constant pointer type!"
David,
sorry for this email but I noticed I made a mistake in the previous one. So
I managed to compile llvm Debug with asserts release. I have used the
following commands:
cmake -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON ..
cmake --build . -- -j8 && sudo cmake --build . --target install
Once lli was
2010 Aug 17
4
[LLVMdev] clang: call extern function using JIT
hi, im creating a music application(image below).
At the moment im using tcc compiler but im moving across to clang because of
the improved compiler warnings.
Can anyone please explain and show code so I can use clang's JIT to call
functions in my application?
Thanks.
http://old.nabble.com/file/p29449300/51709341.jpeg
--
View this message in context:
2020 Feb 10
2
Interpreter crash due to an "Unknown constant pointer type!"
>
> Hey Lang - does any of this look familiar to you?
I'm afraid not: I know nothing about the interpreter. As far as I'm aware
it's essentially abandonware.
Alberto: The usual recommendation in these circumstances is to use a JIT
class instead of the interpreter. You're using -force-interpreter though,
so I assume you really want to use the interpreter for your use case?
2005 Jan 08
3
[LLVMdev] Primer with LLVM
> >>> Would be great if we append into the documentation several "patters"
> >>> to show how perform with LLVM. It would accelerate the learn curve for
> >>> beginners like me, avoiding basic errors and mistakes. If I reach a
> >>> good level with LLVM I can make these.
> >>
> >> I'm not sure if I understand what you
2005 Jan 08
0
[LLVMdev] Primer with LLVM
On Sat, Jan 08, 2005 at 06:16:47PM +0100, Francisco Puentes wrote:
> I have points 0-4 working, but I am confused about point 5 and maybe 6.
[snip and reorder]
> (5) Generate native (x86) code from generated module
The JIT currently is built to generate native code for a given module, a
function-at-a-time. That means that first, main() is generated, and
anything main() calls is not. As
2012 Dec 27
1
[LLVMdev] Throwing an exception from JITed code, and catching in C++
Hi everyone,
I am writing an application that uses LLVM JIT and I would like to throw an exception from the JIT and catch it in the C++ code that invokes the JIT.
This does not seem to work.
I've written what is hopefully a super simple demonstration to reproduce this.
I would appreciate any help with this.
Thank you
The demonstration is composed of:
1) thrower.cpp - a source file that
2010 Jun 20
2
[LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
I have followed http://llvm.org/docs/DebuggingJITedCode.html, used the
latest release gdb-7.1 (from March 18, 2010) and got this stack:
(gdb) bt
#0 0x35532156 in ?? ()
#1 0x355320f8 in ?? ()
#2 0x35532098 in ?? ()
#3 0x3553202e in ?? ()
#4 0x34a5661a in ?? ()
#5 0x349d9bd9 in ?? ()
#6 0x08052cd9 in main (argc=4, argv=0xbfbfe264, envp=0xbfbfe278) at
2019 Dec 24
2
Interpreter crash due to an "Unknown constant pointer type!"
Hi David,
In pretty sure that the crash is due to the instruction I have shared in my
first email. In order to run pngpixel you just need libpng and zlib..
honest I thought that the .bc had Al the necessary. I'm happy to help you
to reproduce it. As a curiosity, why do you think you cannot reproduce it?
Unfortunately I won't be able to modify the interpreter soon.. anyway, I'll
try to
2010 Aug 17
0
[LLVMdev] clang: call extern function using JIT
On Aug 17, 2010, at 1:56 PM, gafferuk wrote:
>
> hi, im creating a music application(image below).
>
> At the moment im using tcc compiler but im moving across to clang because of
> the improved compiler warnings.
> Can anyone please explain and show code so I can use clang's JIT to call
> functions in my application?
You'll probably want to take a look at the
2009 Mar 09
0
[LLVMdev] Cross-Module Function Calls
I have had great luck in the last couple of months getting llvm to do
cool stuff with directly linked modules using llvm-as and llvm-ld. Now,
I would like to get some of the same functionality working through an
ExecutionEngine; however, I am having trouble making functions call
across module boundaries. I know from previous discussions on this list
that what I am attempting should be easy. I
2010 Aug 18
0
[LLVMdev] clang: call extern function using JIT
I tried what you said, now I get:
LLVM ERROR: Program used external function 'yipee' which could not be
resolved!
Stack dump:
0. Running pass 'X86 Machine Code Emitter' on function '@main'
did not even get as far as a breakpoint.
Óscar Fuentes wrote:
>
> gafferuk <gafferuk at gmail.com> writes:
>
>> Im confused. The function i wish to call is
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
Heres my full code listing, im totally stuck.
// Whistle.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Tool.h"
#include
2010 Aug 18
2
[LLVMdev] clang: call extern function using JIT
gafferuk <gafferuk at gmail.com> writes:
> Im confused. The function i wish to call is a return type of int.
> Im calling it with int dd = yipee(1);
>
> What's wrong?
Declare the function:
int yipee(int);
int main()
{
int dd = yipee(1);
return 0;
}
If that still crashes, put a breakpoint on `yipee' and see if the
execution gets there, if the argument is
2019 Mar 12
3
Help with bitcast instruction
Hi Tim,
I'm still struggling on the instruction:
call void bitcast (void (%struct.png_struct_def.68*, i8*, i8*
(%struct.png_struct_def.68*, i64)*, void (%struct.png_struct_def.68*,
i8*)*)* @png_set_mem_fn to void (%struct.png_struct_def*, i8*, i8*
(%struct.png_struct_def*, i64)*, void (%struct.png_struct_def*,
i8*)*)*)(%struct.png_struct_def* %create_struct, i8* %mem_ptr, i8*
2018 Jun 12
2
Proper method to initialize all LLVM Internal Data Structures?
Hi:
I'm building a small tool on top of LLVM Core Library.
```
LLVMContext context;
SMDiagnostic diag;
Module *M = parseIRFile(InputIR, diag, context).get();
if (M == nullptr) {
diag.print("LLVM", errs());
exit(-1);
}
assert(M->isMaterialized() && "Module not materialized!");
PointerType *ArrayPtrTy =
2019 Jan 26
3
How to debug .ll file with segmentation fault?
Could you give specific pointers to the resources that are relevant to
segmentation fault debugging? This kind of bug is the hardest to bebug
because the error message has nothing to do with the actual bug.
Generic advices without consideration of specific properties of the problem
will surely end up inefficient debugging.
What I added to the .ll file in this case are just function calls to
2013 Mar 20
0
[LLVMdev] Problems with parallelizing lli
Hi,
I am trying to parallize the lli interpreter (code: http://pastebin.com/6iuHNH3Q). I am using ubuntu 12.04 with llvm
version 3.1. Each thread uses a seperate LLVMContext, however the
interpreter continues to crash.
Error msg: ..../include/llvm/Support/Mutex.h:116:
bool llvm::sys::SmartMutex<true>::release(): Assertion `((recursive &&
acquired) || (acquired == 1)) &&
2019 Jan 20
3
(no subject)
Hi all,
I have the following C code:
#include<stdio.h>
int main(int argc, char *argv[]) {
printf("%s\n", argv[0]);
return argc;
}
that generates the following IR for the main function:
; Function Attrs: noinline nounwind optnone uwtable
define i32 @main(i32, i8**) #0 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
%5 = alloca i8**, align 8
store i32 0, i32*
2010 Jan 22
0
[LLVMdev] Exception handling question
Interesting. Was this the reason you were getting the recursive compilation error in JIT::runJITOnFunctionUnlocked(...) (isAlreadyCodeGenerating)?
Do you have the time to try your test with 2.7?
Garrison
On Jan 22, 2010, at 17:37, James Williams wrote:
> I've worked around this issue in my test case by simply calling my personality function on program to ensure it's JIT'ed