Hello;
I wanted to insert two new terminator instructions in LLVM IR. I modified the necessary files (as mentioned in the tutorial in LLVM site and some more to meet the new structure of LLVM, (e.g no Lexer.l now, we have LLLexer.cpp. Again in the tutorial, files like LLVMBitCodes.h, include/llvm-c/core.h that need to be modified are not mentioned) But I am getting the error while building LLVM. The SelectionDagBuilder.cpp file is giving the error.
In file included from /home/arnie/llvm-svn/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:946:0:
/home/arnie/llvm-svn/llvm/include/llvm/Instruction.def: In member function ‘void llvm::SelectionDAGBuilder::visit(unsigned int, const llvm::User&)’:
/home/arnie/llvm-svn/llvm/include/llvm/Instruction.def:104:1: error: ‘visitXXX’ was not declared in this scope
/home/arnie/llvm-svn/llvm/include/llvm/Instruction.def:105:1: error: ‘visitYYY’ was not declared in this scope
But part of my Instruction.def looks like this (after inserting XXX and YYY)- .
…
HANDLE_TERM_INST ( 7, Unreachable, UnreachableInst)
HANDLE_TERM_INST ( 8, XXX , XXXInst)
HANDLE_TERM_INST ( 9, YYY , YYYInst)
LAST_TERM_INST ( 9)
…
Can anybody guess what may be the reason of this error? Did I miss any files that need to be modified. Below are the list of files I modified to add new LLVM IR instruction.
llvm/include/llvm/Instruction.def
llvm/include/llvm/Instructions.h
llvm/include/llvm/Support/InstVisitor.h
llvm/lib/AsmParser/< necessary files>
llvm/include/llvm/Bitcode/LLVMBitCodes.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/VMCore/Instruction.cpp
llvm/lib/VMCore/Instructions.cpp
llvm/include/llvm-c/core.h
Thank you;