Search code examples
c++xcodexcode7llvmllvm-clang

LLVM 3.8: implementing a pass with ad IDE (Xcode)


I'm a newbie in both LLVM developing and cpp.

I wanted to ask if there was a way to develop a pass for LLVM in Xcode having all the typical features available in an IDE like autocomplete and syntax code highlighting.

Right now I am just writing c++ code, checking everything I need on the documentation, but, as you can imagine, this is really slowing me down and it's really error prone...

Don't know if this can help, but my LLVM folder is structured this way:

  • "llvm_3.8_source/" root folder of llvm3.8 source files
  • "llvm_3.8_source/build" root folder of my llvm3.8 build

Thanks


Solution

  • Yes, it is possible.

    LLVM uses CMake as a build-system generator. CMake supports such things as old good makefiles, ninja, xcode, and visual studio.

    You can simply create Xcode-project using the following commands from terminal:

    cd llvm_build
    cmake -G Xcode path/to/llvm/sources
    open LLVM.xcodeproj
    

    First you will see lots of errors and 'red' marks. It's because some parts of LLVM sources are generated during compilation. All files will be generated as soon as you attempt to build project first time and all the 'red' marks will gone.

    You can read this article to get a bit more info on the topic:

    Getting started with LLVM/Clang on OS X