Tuesday, September 13, 2011

Report for LLVM Project

I get the SVN version of LLVM.

There are two kinds of LLVM: LLVM source code, and LLVM GCC front end. What I'm trying is LLVM source code.

In Ubuntu, it has some bug if associated with dragonegg module:

https://bugs.launchpad.net/ubuntu/+source/dragonegg/+bug/787800

The above is the bug report, and the solution is in #3.

Bug happened when I used llvm to compile toy.cpp:


----------------------------------------------------------------------------------------------
toy.cpp: In member function ‘virtual llvm::Value* CallExprAST::Codegen()’:
toy.cpp:401:75: error: no matching function for call to ‘llvm::IRBuilder<>::CreateCall(llvm::Function*&, std::vector<llvm::Value*, std::allocator<llvm::Value*> >::iterator, std::vector<llvm::Value*, std::allocator<llvm::Value*> >::iterator, const char [8])’
/usr/local/include/llvm/Support/IRBuilder.h:1119:13: note: candidates are: llvm::CallInst* llvm::IRBuilder<preserveNames, T, Inserter>::CreateCall(llvm::Value*, const llvm::Twine&) [with bool preserveNames = true, T = llvm::ConstantFolder, Inserter = llvm::IRBuilderDefaultInserter<true>]
/usr/local/include/llvm/Support/IRBuilder.h:1122:13: note:                 llvm::CallInst* llvm::IRBuilder<preserveNames, T, Inserter>::CreateCall(llvm::Value*, llvm::Value*, const llvm::Twine&) [with bool preserveNames = true, T = llvm::ConstantFolder, Inserter = llvm::IRBuilderDefaultInserter<true>]
/usr/local/include/llvm/Support/IRBuilder.h:1146:13: note:                 llvm::CallInst* llvm::IRBuilder<preserveNames, T, Inserter>::CreateCall(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&) [with bool preserveNames = true, T = llvm::ConstantFolder, Inserter = llvm::IRBuilderDefaultInserter<true>]
toy.cpp: In member function ‘llvm::Function* PrototypeAST::Codegen()’:
toy.cpp:409:54: error: no matching function for call to ‘llvm::FunctionType::get(llvm::Type*, std::vector<const llvm::Type*>&, bool)’
/usr/local/include/llvm/DerivedTypes.h:105:24: note: candidates are: static llvm::FunctionType* llvm::FunctionType::get(llvm::Type*, llvm::ArrayRef<llvm::Type*>, bool)
/usr/local/include/llvm/DerivedTypes.h:110:24: note:                 static llvm::FunctionType* llvm::FunctionType::get(llvm::Type*, bool)
--------------------------------------------------------------------------------------------------