llvm

Static library not included in resulting LLVM executable

Hi, I am trying to compile a c program using LLVM and I am having trouble getting some static libraries included. I have successfully compiled those static libraries using LLVM and, for example, libogg.a is present, as is ogg.l.bc. However, when I try to build the final program, it does not include the static ogg library. I've tried va...

crash when linking swc with Alchemy

I have a project I'm trying to compile with alchemy. It will compile .o and .a files, but when trying to create a .swc, it will fail. It appears to crash with this error: g++ -swc -o mylib.swc my-flex-interface.cpp mylib.a Cannot yet select: 0x279c810: ch,flag = AVM2ISD::CALL - A call instruction 0x279c7a0, 0x29c4350 0 llc ...

Where is the VM in LLVM?

Note: marked as community wiki. Where is the Low Level Virtual Machine in LLVM? I see that we have llvm-g++ and c-lang, but to me, a LLVM is something almost like Valgrind of a simulator, where instructions are executed on it, and I can write programs to instrument the running code / interrupt when certain conditions happen / etc ... ...

running x86 program _on_ llvm

Is it possible to use llvm to run x86 programs? I.e. I want to use llvm as an x86 simulator to run x86 programs and then instrument the x86 program. Thanks! ...

Curious: Could LLVM be used for Infocom z-machine code, and if so how? (in general)

Forgive me if this is a silly question, but I'm wondering if/how LLVM could be used to obtain a higher performance Z-Machine VM for interactive fiction. (If it could be used, I'm just looking for some high-level ideas or suggestions, not a detailed solution.) It might seem odd to desire higher performance for a circa-1978 technology, bu...

Make LLVM inline a function from a library

I am trying to make LLVM inline a function from a library. I have LLVM bitcode files (manually generated) that I linked together with llvm-link, I also have a library (written in C) compiled into bitcode by clang and archived with llvm-ar. I manage to link everything together and to execute but i can't manage to get LLVM to inline a func...

what is the advantage of using negative enums

In the kaleidoscope parser / AST example at LLVM, the enum is given all negative values. Why the minus sign ? enum Token { tok_eof = -1, // commands tok_def = -2, tok_extern = -3, // primary tok_identifier = -4, tok_number = -5 }; ...

llvm bindings in lua?

Does LLVM have lua bindings? I'm not interested in using LLVM as a backend /JIT for Lua. I want access to LLVM through lua. Thanks! ...

LLVM: bitcode with llvm-gcc (mingw) for windows

Hi, i'm currently building a small JIT compiler. For the language I need a runtime library for some special math functions. I think the best would be to compile the lib to bitcode and link it. The compiler should be integrated in a product and as of this, it must work under windows (VC10, 64bit). So is it possible to build the math li...

Linking LLVM JIT Code to Static LLVM Libraries?

I'm in the process of implementing a cross-platform (Mac OS X, Windows, and Linux) application which will do lots of CPU intensive analysis of financial data. The bulk of the analysis engine will be written in C++ for speed reasons, with a user-accessible scripting engine interfacing with the C++ testing engine. I want to write several s...

tail call generated by clang 1.1 and 1.0 (llvm 2.7 and 2.6)

After compilation next snippet of code with clang -O2 (or with online demo): #include <stdio.h> #include <stdlib.h> int flop(int x); int flip(int x) { if (x == 0) return 1; return (x+1)*flop(x-1); } int flop(int x) { if (x == 0) return 1; return (x+0)*flip(x-1); } int main(int argc, char **argv) { printf("%d\n", flip(atoi(ar...

Use an LLVM compiled version of Qt

I've seen some mkspec for mac or linux using llvm. Does anyone use an llvm compiled version of Qt ? Or llvm on their Qt Projects ? does it speed up compilation times ? Is your project faster ? ...

LLVM: Passing a pointer to a struct, which holds a pointer to a function, to a JIT function

I have an LLVM (version 2.7) module with a function that takes a pointer to a struct. That struct contains a function pointer to a C++ function. The module function is going to be JIT-compiled, and I need to build that struct in C++ using the LLVM API. I can't seem get the pointer to the function as an LLVM value, let alone pass a pointe...

Functional languages targeting the LLVM

Are there any languages that target the LLVM that: Are statically typed Use type inference Are functional (i.e. lambda expressions, closures, list primitives, list comprehensions, etc.) Have first class object-oriented features (inheritance, polymorphism, mixins, etc.) Have a sophisticated type system (generics, covariance and contrava...

What does this LLVM 1.5 warning mean? "protocol qualifiers without 'id' is archaic"

I've just tried compiling an iOS project using the the LLVM 1.5 compiler (included in XCode 3.2.3), and I got a lot of new warnings, including several like this: protocol qualifiers without 'id' is archaic For instance, this happens on lines like this: - (id)initWithContext:(NSManagedObjectContext *)context coordinator:(NSP...

Can I bind an existing method to a LLVM Function* and use it from jitted code?

Hey guys, I'm toying around with the LLVM C++ API. I'd like to JIT compile code and run it. However, I need to call a C++ method from said jitted code. Normally, LLVM treats method calls as function calls with the object pointer passed as the first argument, so calling shouldn't be a problem. The real problem is to get that function in...

LLVM extern functions

I have recently started experimenting with LLVM under MinGW. I have read the Kaleidoscope tutorial but now I'm having problems with external functions. I'm declaring external functions like this: const Type* doubleType = Type::getPrimitiveType(ctx, Type::DoubleTyID); std::vector<const Type*> doubleParams; doubleParams.push_back(doubleT...

What are Scala's future platform concerns people should be prepared for?

At the moment Scala runs only on the JVM, with an outdated implementation for the CLR. But there are some voices at the moment, that Microsoft is interested funding an up-to-date Scala port for .NET. Considering the lack of any plan or oversight at Oracle's side what to do with Java/the JVM/the ecosystem, how can a Scala developer be p...

Are llvm-gcc and clang binary compatible with gcc? - particularly mingw gcc on Windows.

If I build a static library with llvm-gcc, then link it with a program compiled using mingw gcc, will the result work? The same for other combinations of llvm-gcc, clang and normal gcc. I'm interested in how this works out on Linux (using normal non-mingw gcc, of course) and other platforms as well, but the emphasis is on Windows. I'm ...

Any tutorial for embedding Clang as script interpreter into C++ Code?

I have no experience with llvm or clang, yet. From what I read clang is said to be easily embeddable Wikipedia-Clang, however, I did not find any tutorials about how to achieve this. So is it possible to provide the user of a c++ application with scripting-powers by JIT compiling and executing user-defined code at runtime? Would it be po...