Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74310 - in trunk/libs/spirit/example/qi/compiler_tutorial: . conjure3
From: joel_at_[hidden]
Date: 2011-09-08 05:16:50


Author: djowel
Date: 2011-09-08 05:16:49 EDT (Thu, 08 Sep 2011)
New Revision: 74310
URL: http://svn.boost.org/trac/boost/changeset/74310

Log:
- using LLVM 2.9 release
- added bjam for msvc
Text files modified:
   trunk/libs/spirit/example/qi/compiler_tutorial/Jamfile | 60 ++++++++++++++++++++++++++++++++++++++++
   trunk/libs/spirit/example/qi/compiler_tutorial/conjure3/compiler.cpp | 12 ++++----
   2 files changed, 66 insertions(+), 6 deletions(-)

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/Jamfile
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/Jamfile (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/Jamfile 2011-09-08 05:16:49 EDT (Thu, 08 Sep 2011)
@@ -12,6 +12,8 @@
     :
     ;
 
+import modules ;
+
 exe calc1 : calc1.cpp ;
 exe calc2 : calc2.cpp ;
 exe calc3 : calc3.cpp ;
@@ -63,4 +65,62 @@
     conjure2/vm.cpp
     ;
 
+#==============================================================================
+# conjure3 and above require LLVM. Make sure you provide the
+# LLVM_PATH in your bjam invocation. E.g.:
+#
+# bjam msvc -sLLVM_PATH=C:/dev/llvm conjure3
+#
+#==============================================================================
+
+if [ modules.peek : LLVM_PATH ]
+{
+ LLVM_PATH = [ modules.peek : LLVM_PATH ] ;
+}
+
+if $(LLVM_PATH)
+{
+ LLVM_LIB_DEBUG_PATH = $(LLVM_PATH)/lib/Debug ;
+ LLVM_LIB_RELEASE_PATH = $(LLVM_PATH)/lib/Release ;
+ LLVM_LINKER_FLAGS =
+ "advapi32.lib"
+ "shell32.lib"
+ ;
+
+ conjure3sources =
+ conjure3/compiler.cpp
+ conjure3/expression.cpp
+ conjure3/function.cpp
+ conjure3/lexer.cpp
+ conjure3/main.cpp
+ conjure3/statement.cpp
+ conjure3/vm.cpp
+ ;
+
+ exe conjure3 :
+ $(conjure3sources)
+
+ # bring in the LLVM libs
+ [ glob $(LLVM_LIB_DEBUG_PATH)/LLVM*.lib ]
+ :
+ <variant>debug
+ <toolset>msvc
+ <include>$(LLVM_PATH)/include
+ <linkflags>$(LLVM_LINKER_FLAGS)
+ ;
+
+ exe conjure3 :
+ $(conjure3sources)
+
+ # bring in the LLVM libs
+ [ glob $(LLVM_LIB_RELEASE_PATH)/LLVM*.lib ]
+ :
+ <variant>release
+ <toolset>msvc
+ <include>$(LLVM_PATH)/include
+ <linkflags>$(LLVM_LINKER_FLAGS)
+ ;
+}
+
+
 

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/conjure3/compiler.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/conjure3/compiler.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/conjure3/compiler.cpp 2011-09-08 05:16:49 EDT (Thu, 08 Sep 2011)
@@ -313,8 +313,8 @@
     function::arg_range function::args() const
     {
         BOOST_ASSERT(c != 0);
- argval_iterator first(f->arg_begin(), to_value());
- argval_iterator last(f->arg_end(), to_value());
+ arg_val_iterator first(f->arg_begin(), to_value());
+ arg_val_iterator last(f->arg_end(), to_value());
         return arg_range(first, last);
     }
 
@@ -449,12 +449,12 @@
       , std::string const& name
       , std::size_t nargs)
     {
- llvm::Type* int_type =
+ llvm::Type const* int_type =
             llvm::Type::getIntNTy(context(), int_size);
- llvm::Type* void_type = llvm::Type::getVoidTy(context());
+ llvm::Type const* void_type = llvm::Type::getVoidTy(context());
 
- std::vector<llvm::Type*> ints(nargs, int_type);
- llvm::Type* return_type = void_return ? void_type : int_type;
+ std::vector<llvm::Type const*> ints(nargs, int_type);
+ llvm::Type const* return_type = void_return ? void_type : int_type;
 
         llvm::FunctionType* function_type =
             llvm::FunctionType::get(void_return ? void_type : int_type, ints, false);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk