[LLVMdev] Kaleidoscope tutorial failed at Chapter 4...

Alex.Wang alex.w.y.wang at gmail.com
Tue Dec 2 07:47:16 PST 2008


Hi everyone. I am using LLVM 2.4 release to practise the tutorial at
Kaleidoscope Chapter 4.
I built the LLVM library, and created my own project, and then paste the
code from the tutorial into my own project. Then after compiled and built
it, I passed the built stage. (I am using visual studio 2005 )

However, when I tried to input some code in the command line window, the
sample program crashed. And the Visual Studio 2005 debugger told me that
"Access violation reading location 0x00000008."
And then it jumped to the code:
"  const TargetData *getTargetData() const { return TD; }"
Actually, these codes are suspicous:

TheExecutionEngine = ExecutionEngine::create(TheModule);
  // Set up the optimizer pipeline.  Start with registering info about how
the
  // target lays out data structures.
  OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));

There is nothing to initialize the TD variable, so the exception is quite
understandable. But how to eliminate this problem? Can anyone give me a
help?

Thank you very much for any guidance.

-- 
Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081202/53b92c93/attachment.html>


More information about the llvm-dev mailing list