What exactly is LLVM?

LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine code. LLVM can be used as a compiler framework, where you provide the “front-end” (parser and lexer) and the “back-end” (code that converts LLVM’s representation to actual machine code). LLVM can also act as a JIT compiler – it … Read more

Clang(LLVM) compile with frameworks

This has been already answered in the Apple developer forum, you can find the whole discussion in here. In the answer marked as the solution to the question they say: 1 – check your PATH variable first: $ echo $PATH 2 – assuming /System/Library/Frameworks is not included in PATH, add it: $ PATH=$PATH:/System/Library/Frameworks 3 -now … Read more

What can make C++ RTTI undesirable to use?

There are several reasons why LLVM rolls its own RTTI system. This system is simple and powerful, and described in a section of the LLVM Programmer’s Manual. As another poster has pointed out, the Coding Standards raises two major problems with C++ RTTI: 1) the space cost and 2) the poor performance of using it. … Read more

How can I force Xcode to use a custom compiler?

People say it is possible with custom toolchains. I didn’t make a research on them because easier solution worked well for me: It is also possible to run frontend plugins directly by setting appropriate “build settings” of Xcode. (Several ways to do this, you can set them on the command line for instance: xcodebuild build … Read more

Under what conditions is @synthesize automatic in Objective-c?

As of clang 3.2 (circa February 2012), “default synthesis” (or “auto property synthesis”) of Objective-C properties is provided by default. It’s essentially as described in the blog post you originally read: http://www.mcubedsw.com/blog/index.php/site/comments/new_objective-c_features/ (except that that post describes the feature as “enabled, then disabled”; I don’t know if that’s an issue with Xcode or if the … Read more

Using Clang to compile for RISC-V

Foreknowledge: I had same delusion about this: “If llvm is targeting for all backends including riscv, we should be able to compile our codes just giving a clang flag like –target=riscv32, -target riscv64 etc. without doing extra operation” and I had similar question, but it is not like that. Although LLVM supports riscv target, you … Read more