llvm

Xcode 4.2 + c++0x/libc++ cannot find iostream

a 夏天 提交于 2019-11-29 22:14:49
问题 I'm using Macbook 1g, Snow Leopard. Few days ago i installed xcode 4.2 and made a test project for c++0x. I set LLVM 3.0 as c++ compiler, C++ Language Dialect as C++0x and C++ Standard Library as libc++. but when building, error occured. "iostream" file not found I find it most bewildering. How can I solve this problem? 回答1: "I changed libc++ to libstdc++". How? Where is this setting? Apple documentation says "simply set "C++ Standard Library Type" in the build settings to ... " Build

Is it possible to transform LLVM bytecode into Java bytecode?

一笑奈何 提交于 2019-11-29 19:58:32
I have heard that google app engine can run any programming language that can be transformed to Java bytecode via it's JVM . I wondered if it would be possible to convert LLVM bytecode to Java bytecode as it would be interesting to run languages that LLVM supports in the Google App Engine JVM . It does now appear possible to convert LLVM IR bytecode to Java bytecode, using the LLJVM interpreter . There is an interesting Disqus comment (21/03/11) from Grzegorz of kraytracing.com which explains, along with code, how he has modified LLJVM's Java class output routine to emit non-monolithic Java

Why is llvm considered unsuitable for implementing a JIT?

天涯浪子 提交于 2019-11-29 19:36:13
Many dynamic languages implement (or want to implement) a JIT Compiler in order to speed up their execution times. Inevitably, someone from the peanut gallery asks why they don't use LLVM. The answer is often, "LLVM is unsuitable for building a JIT." (For Example, Armin Rigo's comment here. ) Why is LLVM Unsuitable for building a JIT? Note: I know LLVM has its own JIT. If LLVM used to be unsuitable, but now is suitable, please say what changed. I'm not talking about running LLVM Bytecode on the LLVM JIT, I'm talking about using the LLVM libraries to implement a JIT for a dynamic language.

LLVM C++ IDE for Windows

孤者浪人 提交于 2019-11-29 18:44:25
Is there some C/C++ IDE for Windows, which is integrated with the LLVM compiler (and Clang C/C++ analyzer), just like modern Xcode do. I have Dev-Cpp (it uses outdated GCC) and Code::Blocks (with some GCC). But GCC gives me very cryptic error messages. I want to get some more user-friendly error messages from the Clang frontend. Yes, Clang was not able to be used with complex C++ code, but trunk Clang already can compile LLVM itself. So I wonder if is there any of LLVM IDEs in development or in beta versions. Yes, I can use Clang as other compiler with GCC-compatible IDEs. But is there any IDE

llvm 3.42 build from source fails on ubuntu 17.04

瘦欲@ 提交于 2019-11-29 17:41:36
I have a script that builds llvm/clang 3.42 from source (with configure+make). It runs smooth on ubuntu 14.04.5 LTS . When I upgraded to ubuntu 17.04 , the build fails. Here is the building script: svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_342/final llvm svn co https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_342/final llvm/tools/clang svn co https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_342/final llvm/projects/compiler-rt svn co https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_342/final llvm/projects/libcxx rm -rf llvm/.svn rm -rf llvm/tools/clang/.svn rm

Convert Objective-C enum constants to string names

荒凉一梦 提交于 2019-11-29 15:19:22
Previously, this was impossible (you have to write it all out by hand / create a static array / put all the values into a dictionary and read them back ... etc) But I've noticed that the latest Xcode's lldb (4.6, maybe earlier versions too) is automatically converting enum-constants to strings. My problem is that we use a lot of libraries - including Apple's own! - which use annoying public enums with no "value-to-string" method offered. So I end up having to (many, many times over) do the "well, since Mr. Library Author didn't do this, now I have to make the static array for them...". I kept

How to cross-compile clang/llvm for iOS?

谁都会走 提交于 2019-11-29 14:37:06
问题 How to cross-compile clang/llvm for iOS? I need to get libclang (.a or .dylib i believe) to use it via C API in my iOS app. 回答1: # Get LLVM/Clang mkdir llvm curl -O http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz tar xzfv llvm-3.4.src.tar.gz cd llvm-3.4/tools/ curl -O http://llvm.org/releases/3.4/clang-3.4.src.tar.gz tar xzfv clang-3.4.src.tar.gz mv clang-3.4 clang cd .. # Assuming Xcode 5.1 (LLVM 3.5+ requires -stdlib=libc++ as well) export CC="clang -arch armv7 -mios-version-min=5.0

Call llvm-config --prefix and use it in a BUILD rule

亡梦爱人 提交于 2019-11-29 13:11:17
I have a following rule in WORKSPACE : new_local_repository( name = "llvm", path = "/opt/local/libexec/llvm-4.0", build_file= "llvm.BUILD") I would like to now use hardcoded path for llvm. llvm-config --prefix can give me the directory for llvm. What is the correct way to get this? Can I just use standard python commands (e.g. subprocess package)? As @abergmeier said, you can create a custom repository rule, run the command, create a symlink pointing to its output, and create a BUILD file for the repository: WORKSPACE file: workspace(name = "io_bazel") load("//foo:repo.bzl", "llvm_configure")

llvm-link with external libraries

[亡魂溺海] 提交于 2019-11-29 13:08:34
I'm now playing with LLVM and it's JIT. I'm pretty interested in the JIT and then I wrote a small GTK+ hello world: #include <gtk/gtk.h> int main () { gtk_init(NULL, NULL); GtkWidget *win = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL); GtkWidget *lbl = gtk_label_new ("hello world"); gtk_container_add (GTK_CONTAINER (win), lbl); gtk_widget_show_all (win); gtk_main(); return 0; } I compiled it into Bitcode this way: clang -emit-llvm -S a.c `pkg-config --cflags gtk+-3.0` llvm-link a.s -o a.o But when I run it > lli a.o LLVM ERROR:

Why is the -ObjC linker flag needed to link categories in static libraries? (LLVM)

房东的猫 提交于 2019-11-29 13:01:53
问题 Regarding this technical Q&A from Apple: http://developer.apple.com/library/mac/#qa/qa1490/_index.html I think the compiler could mark calls to methods defined in categories at compile-time (it knows that they were defined in a category and not the main class because the prototype was in an @interface Class (Category) section) - so it could build a table in the object files of "external category methods". Then the linker, after doing its normal linking, should be able to concatenate/merge and