[LLVMdev] regression? Or did I do something wrong again?

Eli Friedman eli.friedman at gmail.com
Mon Jun 9 12:06:19 PDT 2008


On Mon, Jun 9, 2008 at 7:29 AM, Hendrik Boom <hendrik at topoi.pooq.com> wrote:
> I don't know if the toy program in chapter 4 of the tutorial
> implementing Kaleidoscope in llvm with C++ is part of your
> regression suite

It isn't (although that might be a good idea).

> but with the version of llvm I installed
> last weekend, it does not compile:
>
> hendrik at lovesong:~/dv/llvm/tut$ g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
> toy.cpp: In member function 'virtual llvm::Value* NumberExprAST::Codegen()':
> toy.cpp:359: error: no matching function for call to 'llvm::ConstantFP::get(const llvm::Type*&, llvm::APFloat)'
> /usr/local/llvm/include/llvm/Constants.h:237: note: candidates are: static llvm::ConstantFP* llvm::ConstantFP::get(const llvm::APFloat&)
> /usr/local/llvm/include/llvm/Constants.h:242: note:                 static llvm::ConstantFP* llvm::ConstantFP::get(const llvm::Type*, double)
> hendrik at lovesong:~/dv/llvm/tut$
>
> I cut-and-pasted the sourse from http://llvm.org/docs/tutorial/LangImpl4.html

That should be easy to fix; from the LLVM 2.3 release notes: "The
ConstantFP::get method that uses APFloat now takes one argument
instead of two. The type argument has been removed, and the type is
now inferred from the size of the given APFloat value."  So to make it
compile,  "ConstantFP::get(Type::DoubleTy, APFloat(Val));" needs to be
changed to "ConstantFP::get(APFloat(Val));".

-Eli



More information about the llvm-dev mailing list