llvm

Looking for LLVM-based language which allows to reload part of binary on-the-fly

Are the any GIL-less LLVM-based languages, targeted mainly for JIT-execution which allows to reload PART of the code on the fly? Like re-compile 1 class, and reload it without stopping the whole program. Anyone tryed that? Any chance on doing that with clang (surely, with great deal of developers caution, restriction and manual sta...

Method not found (return type defaults to 'id')

Does anyone know what this LLVM warning means: Method '-retry' not found (return type defaults to 'id') in sourceFile.m I get this warning on the following line of sourceFile.m: [self.operation retry]; My class has a variable 'operation', which is a custom class extending NSOperation. MyCustomOperation* operation; @property (nona...

Is Apple's OpenCL implementation using CLang and LLVM open-source?

It's clear that Apple has an OpenCL implementation based on Clang and LLVM. There's also a talk by an Apple Engineer about what it took to get OpenCL going on LLVM here However, is the code for this implementation available under some sort of open-source license or is this closed source software? If the code hasn't been released, anyo...

Is it possible to read an LLVM bitcode file into an llvm::Module?

I'm writing a compiler with LLVM. Each source file is compiled into an LLVM bitcode file. Eventually the linker links and optimizes all the bitcode files into one final binary. I need a way to read the bitcode files in the compiler in order to access the type information. The LLVM documentation shows a class called BitcodeReader, but th...

LLVM 2.0 can't build for iPhone simulator. GCC 4.2 works fine.

When I build my project (any project, really - I tried creating a new empty project with the same results), it builds fine with GCC 4.2 under either Xcode4 or Xcode 3.2.4. If I build using LLVM 2.0 under Xcode4 or with LLVM 1.5 under Xcode3, I get compile-time build failures, but only when building for the Simulator. The build errors...

Creating a VHDL backend for LLVM?

LLVM is very modular and allows you to fairly easily define new backends. However most of the documentation/tutorials on creating an LLVM backend focus on adding a new processor instruction set and registers. I'm wondering what it would take to create a VHDL backend for LLVM? Are there examples of using LLVM to go from one higher leve...

Error trying to link c++ code using llvm 4.2.1

I am trying to convert some gpl code(not mine!) from C++ to C so I can use it in a c-only project. I read about llvm and got excited but I am running into a linker error that I have no idea how to fix: the error is: Intrinsic prototype has incorrect number of arguments! void (i8*, i8*, i64, i32, i1)* @llvm.memmove.p0i8.p0i8.i64 Broken...

C# P/Invoke: Pointer to string as error message

I am attempting to use llvmc as a C# library using P/Invokes(because I can't find any .NET bindings). However, I've a problem. llvmc uses char** for error passing. An example would be this: char* error = NULL; LLVMVerifyModule(PointerToSomeModule, LLVMAbortProcessAction, &error); What should I do to allow this function to be used in...

Confusing Template error

I've been playing with clang a while, and I stumbled upon "test/SemaTemplate/dependent-template-recover.cpp" (in the clang distribution) which is supposed to provide hints to recover from a template error. The whole thing can be easily stripped down to a minimal example: template<typename T, typename U, int N> struct X { void f(T* ...

HTML5 + LLVM = Win? Or not existent?

I tried a simple breakout clone in a browser and saw it take 25% of my CPU. Sad. I was wondering if LLVM can hook into HTML5 and take advantage of canvus, SVG and etc. If not does LLVM have its own multimedia layer? I ran my version of chrome with --enable-nacl and it looks like it is enabled (half of the native client demos ran http://...

How does C-- compare to LLVM ?

After learning a bit of how LLVM work I'm really excited about how portable low-level code can be generated and how modular this 'things' is built. But I discovered today the existence of C-- that seems to share some concepts with LLVM. So I'm looking for some informations helping me to understand the main differences between this two ...

Building Mesa 3d 7.9 with llvmpipe from LLVM 2.8

First of all, this regards 64bit builds of both in Windows, by Visual Studio 2008, 32bit is no problem. Quite simple question; has anyone successfully built Mesa 7.9 with LLVM 2.8 as pipe? If so, do you happen to remember if you did any changes to SConstruct or any other build related file? I get numerous linking errors whatever I do. ...

How to register a new LLVM backend?

I'm developing a very basic new LLVM backend for a RISC machine (named Risco), based on the existing Sparc backend and this tutorial. To register the backend, I've used the following. At RiscoTargetMachine.cpp: extern "C" void LLVMInitializeRiscoTarget() { // Register the target. RegisterTargetMachine<RiscoSimulatorTargetMachi...

Runtime or compile time for platform-specific libraries?

I'm creating a library in C++. It links against Windows libraries on Windows and Linux libraries on Linux. It's abstracted, all is well. However, is it feasible to dynamically detect, load and use libraries (and copying header files for use) so it could be used on any platform if it was running under LLVM JIT? ...

How do I find all memory allocations in an llvm ir code file?

I tried to compile this snippet of C++ code: void FuncTest() { int* a = new int; int* b = new int[2]; } using: clang test.cpp -S -emit-llvm -o - > test.llvm and obtained this: define void @_Z8FuncTestv() { entry: %a = alloca i32*, align 4 %b = alloca i32*, align 4 %call = call noalias i8* @_Znwj(i32 4) %0 = bitcast...

LLVM Compiler 2.0: Warning with "using namespace std;"

In Xcode using LLVM 2.0, when I put the line using namespace std; in my C++ code, I get this warning: Semantic Issue Using directive refers to implicitly-defined namespace 'std' Is there a way to fix this? Why is it giving that warning? ...

LLVM - Invalid instruction with no BB

Someone know what this error means? I get the error when I try to disassemble a file written by LLVMWriteBitcodeToFile. When I dump the module using LLVMDumpModule and manually assemble and disassemble the file no error occurs. The module that i am trying to compile (from LLVMDumpModule) looks like: ; ModuleID = 'Test' define i32 @a(i...

How are classes implemented in compilers

I'd like to implement a class type for my own little language but what I thought at first wouldn't be too hard has got me stumped. I have the parser in place and it's the code generation side of things I'm having problems with. Can anyone shed any light on the best/correct way to go about this? Specifically I'd like to do this in LLVM so...

llvm/tools: lli REPL

Hi. I was wondering if someone has had experience with the llvm/tools - lli interpreter/JIT-compiler (cf. http://llvm.org/docs/GettingStarted.html#tools). I am interested in any information that you can provide (speed, complexity, implementations, etc.). Thanks. UPDATE: Okay how would bitcode execution be compared to LuaJIT VM execut...

Obtaining line numbers for diagnostics when writing a scripting-language compiler?

I'm currently writing a scripting language compiler using LLVM that can compile to executable code and use a JIT too. The problem I have is to show line numbers in diagnostic messages. Here is some sample code which might be output by my backend (not exactly, but roughly) ; allocate three values. Two for the operands and one for the r...