[LLVMdev] Issues with compiling the Hello pass

Zhoulai zell08v at gmail.com
Sat Apr 11 18:20:42 PDT 2015


Hello,

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,

*http://llvm.org/releases/3.6.0/docs/WritingAnLLVMPass.html#quick-start-writing-hello-world
<http://llvm.org/releases/3.6.0/docs/WritingAnLLVMPass.html#quick-start-writing-hello-world>*I
put the CMake project of 'Hello pass' outside the source tree. Its
structure is as follows:

*<root_of_Hello_project>*




*├── 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=<path>/share/llvm/cmake/ ../../*
*$ make*

where the <path> 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.

Zhoulai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150411/abe8fdc0/attachment.html>


More information about the llvm-dev mailing list