llvm

Is there a Clang mingw cross compiler for Linux

别来无恙 提交于 2019-12-18 13:07:51
问题 In Linux, and specifically on Debian or Ubuntu, there are pre-packaged Mingw cross compilers which can generate Windows EXEs. But is there a similar cross compiler using Clang instead of GCC? (Or instructions on how to build such a beast.) 回答1: I've written a tool with which you can compile easily with clang for windows on linux. Check out: https://github.com/tpoechtrager/wclang. 来源: https://stackoverflow.com/questions/12704537/is-there-a-clang-mingw-cross-compiler-for-linux

Why don't iOS framework dependencies need to be explicitly linked to a static library project or framework project when they do for an app project?

假装没事ソ 提交于 2019-12-18 12:38:10
问题 Why exactly is it that when I create an iOS static library project or framework project in Xcode, I don't need to link any iOS SDK frameworks to the project in order to make use of their headers and objects -- for example, I can #import <AudioToolbox/AudioToolbox.h> and put AudioToolbox code in the static library or framework without actually having AudioToolbox added under "Link Binary with Libraries" in build settings or having it present in the file navigator, and the project will build

Dump IR after each llvm optimization (each pass), both llvm ir passes and backend debugging

孤街浪徒 提交于 2019-12-18 12:20:15
问题 I want to find some debugging options for clang/LLVM which work like gcc's -fdump-tree-all-all -fdump-rtl-all-all -fdump-ipa-all-all . Basically I want to have an LLVM IR dumps before and after each optimization pass, also it can be useful to have all dumps of AST from clang and all phases of code generation (backend phases, Selection DAG, ISEL-SDNode, register allocation, MCInsts). I was able to find only the clang's -ccc-print-phases , but it will only print high-level phases names, e.g.

LLVM build options for ARM / RaspberryPi

孤人 提交于 2019-12-18 11:59:54
问题 I'm seeking clarification of what the best build options are for LLVM 3.2 on Raspbian I've fetched the LLVM source of 3.2, and my config is: cd llvm-3.2.src ./configure --build=armv6-unknown-linux-gnueabi \ --host=armv6-unknown-linux-gnueabi \ --target=armv6-unknown-linux-gnueabi --with-cpu=arm1176jzf-s \ --with-float=hard --with-abi=aapcs-vfp --with-fpu=neon \ --enable-targets=arm --enable-optimized --enable-assertions make REQUIRES_RTTI=1 sudo make install I've heard it takes quite a number

What is the actual relation between assembly, machine code, bytecode, and opcode?

时光怂恿深爱的人放手 提交于 2019-12-18 11:55:29
问题 What is the actual relation between assembly, machine code, bytecode, and opcode? I have read most of the SO questions about assembly and machine code, such as this, but they are too high level and do not show examples of actual assembly code being transformed into machine code. As a result, I still don't understand how it works at a deeper level. The ideal answer to this question would show a specific example of some assembly code, such as the snippet below, and how each assembly instruction

Convert Objective-C enum constants to string names

我是研究僧i 提交于 2019-12-18 08:57:42
问题 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

llvm-link with external libraries

老子叫甜甜 提交于 2019-12-18 07:24:43
问题 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

undefined symbol for self-built llvm opt?

若如初见. 提交于 2019-12-18 06:58:03
问题 I write a simple llvm plugin pass that requires opt to load xxx.so file and run a ModulePass. The strange thing is that when I use deb package opt (e.g., from apt-get , let's call it opt-3.7 ), the plugin works fine (the drawback is that it is a Release build); however when I use the opt I build myself (simplify call it opt ), it frequently complains: Error opening 'xxx.so': xxx.so: undefined symbol: _ZNK4llvm12FunctionPass17createPrinterPassERNS_11raw_ostreamERKNSt7__cxx1112basic

Debugger lldb says my object is nil when is not ?

与世无争的帅哥 提交于 2019-12-18 06:48:46
问题 Recently I upgraded my project settings in Xcode 4.3 and now I use the latest llvm debugger: lldb However (sometimes) I have the impression the debugger is not giving me the correct info? Could this be possible? For example, The debugger says _documentsItem is nil (both in in the console and when mouse-over-ing the ivar). But I know it's NOT , that is why I can see it (an UIBarButtonItem) and more important that is why the app stopped at the shown breakpoint) if (_documentsItem) { ... In fact

Debugger steps deeper when trying to step out of C++11 std lib

前提是你 提交于 2019-12-18 05:49:22
问题 I'm using (Apple) LLVM 4.1 within Xcode 4.5 (but I saw the same thing in an earlier beta). I have it targeting C++11 and am using libc++ (the new, C++11 enabled, LLVM version of the std library). In a debug build, if I try to step over code that calls into a std library function (e.g. a std::vector constructor) the debugger stops in the std lib implementation and if I try to step out it steps even deeper! It can take several (sometimes 10 or more) step-outs before I get back to my own code