Issues with compiling the Hello pass


I have some difficulties building the pass specified in lib/Transform/Hello.cpp.

I use LLVM 3.6.0 built by CMake. The system is on Mac OS 10.9.

As required by the documentation of LLVM 3.6,
I put the CMake project of ‘Hello pass’ outside the source tree. Its structure is as follows:


├── CMakeLists.txt
└── Hello (directory)
├── CMakeLists.txt
├── Hello.cpp
└── _build ( directory)

I use these command lines to compile the pass:

$ cd <root_of_Hello_project>/Hello/_build
$ cmake -DLLVM_DIR=/share/llvm/cmake/ …/…/

$ make

where the above is where I built the whole LLVM using CMake.

I get strange error message

/Users/hostname/MyLib/clang_llvm_src_bin_0409/llvm-3.6.0.src/include/llvm/ADT/Twine.h:83:10: error: ISO
C++ forbids forward references to ‘enum’ types
enum NodeKind : unsigned char {
/Users/hostname/MyLib/clang_llvm_src_bin_0409/llvm-3.6.0.src/include/llvm/ADT/Twine.h:83:30: error:
expected ‘(’ for function-style cast or type construction
enum NodeKind : unsigned char {
~~~~~~~~ ^
/Users/hostname/MyLib/clang_llvm_src_bin_0409/llvm-3.6.0.src/include/llvm/ADT/Twine.h:83:5: error: field
has incomplete type ‘enum NodeKind’
enum NodeKind : unsigned char {
/Users/hostname/MyLib/clang_llvm_src_bin_0409/llvm-3.6.0.src/include/llvm/ADT/Twine.h:83:10: note:
forward declaration of ‘llvm::NodeKind’
enum NodeKind : unsigned char {

Any idea to fix this? Thanks in advance.