[LLVMdev] a bug in Kaleidoscope code

Jun Koi junkoi2004 at gmail.com
Wed Oct 17 08:49:05 PDT 2012


hi,

with LLVM 3.1, i am trying to compile toy.cpp from
http://llvm.org/docs/tutorial/LangImpl7.html#code.

i got the following error:

$ clang++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit
native` -O3 -o toy
toy.cpp:4:10: fatal error: 'llvm/IRBuilder.h' file not found
#include "llvm/IRBuilder.h"


i fixed this by modifying the broken line to:

#include "llvm/Support/IRBuilder.h"


then i compiled again, but got another error:

$ clang++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit
native` -O3 -o toy
toy.cpp:1115:18: error: unknown type name 'DataLayout'
  OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));


this is due to the removal of DataLayout structure from 3.1.
how can i fix this bug?

thanks,
Jun



More information about the llvm-dev mailing list