[PATCH] Fix flags for compiling examples/Kaleidoscope/MCJIT/initial

Renato Golin renato.golin at linaro.org
Tue Jul 22 05:00:01 PDT 2014

Comment at: examples/Kaleidoscope/MCJIT/initial/Makefile:3
@@ -3,2 +2,2 @@
 toy-mcjit : toy.cpp
-	clang++ toy.cpp -g -O3 -rdynamic -fno-rtti `llvm-config --cppflags --ldflags --libs core mcjit native` -o toy-mcjit
+	clang++ toy.cpp -g -O3 -rdynamic -fno-rtti `llvm-config --cxxflags --ldflags --libs core mcjit native` -pthread -ldl -lcurses -o toy-mcjit
This should be ok, but again, people that have worked on the tutorial should have a better opinion.

Comment at: examples/Kaleidoscope/MCJIT/initial/toy.cpp:794
@@ -793,3 +793,3 @@
     // target lays out data structures.
-    FPM->add(new DataLayout(*NewEngine->getDataLayout()));
+    FPM->add(new DataLayoutPass(*NewEngine->getDataLayout()));
     // Provide basic AliasAnalysis support for GVN.
It seems that all MCJIT Kaleidoscope files have this, as well as the documentation in docs/tutorial. If you're going to change, better change all.

Also, from other patterns, the DataLayoutPass has the following usage:

  new DataLayoutPass(Module)

which is not what you've used. I'm not sure how the pass manager is doing this at the moment, but other people may comment on that. Either way, better change all other files while you're at it.


More information about the llvm-commits mailing list