Hello all, I'm trying the Hello pass example in the "Writing an LLVM Pass" webpage ( http://llvm.org/docs/WritingAnLLVMPass.html#basiccode ). I followed the instructions to compile (with gcc-4.2) the Hello.cpp, but I got the compile errors: Hello.cpp:20: error: expected identifier before string constant Hello.cpp:20: error: expected ',' or '...' before string constant Hello.cpp:20: error: expected constructor, destructor, or type conversion before ';' token which is the line "INITIALIZE_PASS(Hello, "Hello", "Hello World Pass", false, false);" in the code. Could any one help me with this? Thank you very much! Best, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100811/46b3ceda/attachment.html>
On Aug 11, 2010, at 8:54 PM, 迪 wrote:> I got the compile errors: > > Hello.cpp:20: error: expected identifier before string constant > Hello.cpp:20: error: expected ',' or '...' before string constant > Hello.cpp:20: error: expected constructor, destructor, or type > conversion before ';' token > > which is the line "INITIALIZE_PASS(Hello, "Hello", "Hello World > Pass", false, false);" in the code.The docs you cited are for the LLVM trunk, and you may be using LLVM 2.7, which may not have a definition of INITIALIZE_PASS. Use the 2.7 docs instead: http://llvm.org/releases/2.7/docs/WritingAnLLVMPass.html#basiccode Trevor
Possibly Parallel Threads
- [LLVMdev] Error in Hello World Pass
- [LLVMdev] About adding a pass into llvm
- [LLVMdev] RFH: passing options from clang down to opt
- Looking for an out-of-source "Hello, world" LLVM/Clang pass example
- Looking for an out-of-source "Hello, world" LLVM/Clang pass example