summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
commitcf099d11218cb6f6c5cce947d6738e347f07fb12 (patch)
treed2b61ce94e654cb01a254d2195259db5f9cc3f3c /examples
parent49011b52fcba02a6051957b84705159f52fae4e4 (diff)
Notes
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt3
-rw-r--r--examples/ExceptionDemo/CMakeLists.txt1
-rw-r--r--examples/ExceptionDemo/ExceptionDemo.cpp3
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp3
-rw-r--r--examples/Kaleidoscope/Chapter5/toy.cpp3
-rw-r--r--examples/Kaleidoscope/Chapter6/toy.cpp3
-rw-r--r--examples/Kaleidoscope/Chapter7/CMakeLists.txt1
-rw-r--r--examples/Kaleidoscope/Chapter7/toy.cpp3
-rw-r--r--examples/Makefile3
-rw-r--r--examples/ModuleMaker/README.txt2
-rw-r--r--examples/OCaml-Kaleidoscope/Chapter6/Makefile9
-rw-r--r--examples/OCaml-Kaleidoscope/Chapter7/Makefile9
12 files changed, 37 insertions, 6 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index f60c0eda03061..54ee6cc3a3a41 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -8,9 +8,6 @@ if( NOT WIN32 )
add_subdirectory(ExceptionDemo)
endif()
-include(CheckIncludeFile)
-check_include_file(pthread.h HAVE_PTHREAD_H)
-
if( HAVE_PTHREAD_H )
add_subdirectory(ParallelJIT)
endif( HAVE_PTHREAD_H )
diff --git a/examples/ExceptionDemo/CMakeLists.txt b/examples/ExceptionDemo/CMakeLists.txt
index d661915568434..88c9ab7c18169 100644
--- a/examples/ExceptionDemo/CMakeLists.txt
+++ b/examples/ExceptionDemo/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS jit nativecodegen)
+set(LLVM_REQUIRES_EH 1)
add_llvm_example(ExceptionDemo
ExceptionDemo.cpp
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp
index e09c990f8a9f0..95ccd24a68941 100644
--- a/examples/ExceptionDemo/ExceptionDemo.cpp
+++ b/examples/ExceptionDemo/ExceptionDemo.cpp
@@ -1974,6 +1974,9 @@ int main(int argc, char* argv[]) {
// Optimizations turned on
#ifdef ADD_OPT_PASSES
+ // Basic AliasAnslysis support for GVN.
+ fpm.add(llvm::createBasicAliasAnalysisPass());
+
// Promote allocas to registers.
fpm.add(llvm::createPromoteMemoryToRegisterPass());
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index 327c5c0591c00..a50d2a43dd287 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -5,6 +5,7 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Analysis/Passes.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -584,6 +585,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+ // Provide basic AliasAnalysis support for GVN.
+ OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
OurFPM.add(createInstructionCombiningPass());
// Reassociate expressions.
diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp
index c98ee88c394fa..26b3db66202f8 100644
--- a/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -5,6 +5,7 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Analysis/Passes.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -829,6 +830,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+ // Provide basic AliasAnalysis support for GVN.
+ OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
OurFPM.add(createInstructionCombiningPass());
// Reassociate expressions.
diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp
index b7b8738f587dd..838125ae77dcf 100644
--- a/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/examples/Kaleidoscope/Chapter6/toy.cpp
@@ -5,6 +5,7 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Analysis/Passes.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -947,6 +948,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+ // Provide basic AliasAnalysis support for GVN.
+ OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
OurFPM.add(createInstructionCombiningPass());
// Reassociate expressions.
diff --git a/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/examples/Kaleidoscope/Chapter7/CMakeLists.txt
index 9b8227c693409..da3839843bd00 100644
--- a/examples/Kaleidoscope/Chapter7/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter7/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_REQUIRES_RTTI 1)
add_llvm_example(Kaleidoscope-Ch7
toy.cpp
diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp
index 0cf7869d02f8f..e63578f57e6c9 100644
--- a/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -5,6 +5,7 @@
#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Analysis/Passes.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -1111,6 +1112,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
OurFPM.add(new TargetData(*TheExecutionEngine->getTargetData()));
+ // Provide basic AliasAnalysis support for GVN.
+ OurFPM.add(createBasicAliasAnalysisPass());
// Promote allocas to registers.
OurFPM.add(createPromoteMemoryToRegisterPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
diff --git a/examples/Makefile b/examples/Makefile
index bc09b8e0473bd..50a6db76aa255 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -10,8 +10,7 @@ LEVEL=..
include $(LEVEL)/Makefile.config
-PARALLEL_DIRS:= BrainF Fibonacci HowToUseJIT Kaleidoscope ModuleMaker \
- TracingBrainF
+PARALLEL_DIRS:= BrainF Fibonacci HowToUseJIT Kaleidoscope ModuleMaker
ifeq ($(HAVE_PTHREAD),1)
PARALLEL_DIRS += ParallelJIT
diff --git a/examples/ModuleMaker/README.txt b/examples/ModuleMaker/README.txt
index ecbe30e4cfe84..66a5d3fe0b1a7 100644
--- a/examples/ModuleMaker/README.txt
+++ b/examples/ModuleMaker/README.txt
@@ -4,5 +4,5 @@
This project is an extremely simple example of using some simple pieces of the
LLVM API. The actual executable generated by this project simply emits an
-LLVM bytecode file to standard output. It is designed to show some basic
+LLVM bitcode file to standard output. It is designed to show some basic
usage of LLVM APIs, and how to link to LLVM libraries.
diff --git a/examples/OCaml-Kaleidoscope/Chapter6/Makefile b/examples/OCaml-Kaleidoscope/Chapter6/Makefile
index 831213863a6e2..21f0c53df4b9d 100644
--- a/examples/OCaml-Kaleidoscope/Chapter6/Makefile
+++ b/examples/OCaml-Kaleidoscope/Chapter6/Makefile
@@ -20,6 +20,15 @@ UsedOcamLibs := llvm llvm_analysis llvm_executionengine llvm_target \
OCAMLCFLAGS += -pp camlp4of
+OcamlSources1 = \
+ $(PROJ_SRC_DIR)/ast.ml \
+ $(PROJ_SRC_DIR)/parser.ml \
+ $(PROJ_SRC_DIR)/codegen.ml \
+ $(PROJ_SRC_DIR)/lexer.ml \
+ $(PROJ_SRC_DIR)/token.ml \
+ $(PROJ_SRC_DIR)/toplevel.ml \
+ $(PROJ_SRC_DIR)/toy.ml
+
ExcludeSources = $(PROJ_SRC_DIR)/myocamlbuild.ml
include $(LEVEL)/bindings/ocaml/Makefile.ocaml
diff --git a/examples/OCaml-Kaleidoscope/Chapter7/Makefile b/examples/OCaml-Kaleidoscope/Chapter7/Makefile
index ddf667b0e123a..99686e17ea80d 100644
--- a/examples/OCaml-Kaleidoscope/Chapter7/Makefile
+++ b/examples/OCaml-Kaleidoscope/Chapter7/Makefile
@@ -20,6 +20,15 @@ UsedOcamLibs := llvm llvm_analysis llvm_executionengine llvm_target \
OCAMLCFLAGS += -pp camlp4of
+OcamlSources1 = \
+ $(PROJ_SRC_DIR)/ast.ml \
+ $(PROJ_SRC_DIR)/parser.ml \
+ $(PROJ_SRC_DIR)/codegen.ml \
+ $(PROJ_SRC_DIR)/lexer.ml \
+ $(PROJ_SRC_DIR)/token.ml \
+ $(PROJ_SRC_DIR)/toplevel.ml \
+ $(PROJ_SRC_DIR)/toy.ml
+
ExcludeSources = $(PROJ_SRC_DIR)/myocamlbuild.ml
include $(LEVEL)/bindings/ocaml/Makefile.ocaml