diff --git a/AUTHORS b/AUTHORS index eae3d6e65f730..0d139781bb6fd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,5 +72,10 @@ a license to everyone to use it as detailed in LICENSE.) * Robert Bragg (copyright owned by Intel Corporation) * Sylvestre Ledru * Tom Fairfield - +* Anthony J. Thibault +* John Allwine +* Martin Gerhardy +* James Gregory (copyright owned by Zynga, Inc) +* Dan Gohman (copyright owned by Google, Inc.) +* Jeff Gilbert (copyright owned by Mozilla Foundation) diff --git a/demos/scons-embind/SConstruct b/demos/scons-embind/SConstruct new file mode 100644 index 0000000000000..8afc3e270549f --- /dev/null +++ b/demos/scons-embind/SConstruct @@ -0,0 +1,23 @@ +env = Environment( + toolpath=['../../scons-tools'], + tools=['cc', 'c++', 'ar', 'emscripten', 'llvm', 'closure'], + LLVM_ROOT='/opt/local/bin', + CLANG='clang-mp-3.2', + CLANGXX='clang++-mp-3.2', + LLVM_LINK='llvm-link-mp-3.2', + LLVM_OPT='opt-mp-3.2', + LLVM_DIS='llvm-dis-mp-3.2', + EMSCRIPTEN_VERSION_FILE=File('build/version_file'), + EMSCRIPTEN_SETTINGS={ + 'ASM_JS': 0, + }) +env['BUILDERS']['WrapInModule'] = Builder( + action='cp $SOURCE $TARGET', +) + +env.Append() +a1 = env.Object('build/foo.bc', 'foo.cpp') +a2 = env.Object('build/bar.bc', 'bar.cpp') +total = env.LLVMLink('build/thelibrary.bc', [a1, a2]) + +env.emscripten('build/thelibrary.js', total) diff --git a/demos/scons-embind/bar.cpp b/demos/scons-embind/bar.cpp new file mode 100644 index 0000000000000..a39080144fbb8 --- /dev/null +++ b/demos/scons-embind/bar.cpp @@ -0,0 +1,2 @@ +void foo() { +} diff --git a/demos/scons-embind/foo.cpp b/demos/scons-embind/foo.cpp new file mode 100644 index 0000000000000..61be501a08f28 --- /dev/null +++ b/demos/scons-embind/foo.cpp @@ -0,0 +1,11 @@ +#include +#include + +void print_some_stuff(int a, float b, const std::string& s) { + printf("print_some_stuff: %d, %f, %s\n", a, b, s.c_str()); +} + +EMSCRIPTEN_BINDINGS(foo) { + emscripten::function("print_some_stuff", &print_some_stuff); +} + diff --git a/demos/scons-embind/test.js b/demos/scons-embind/test.js new file mode 100644 index 0000000000000..a6252fd8c07d6 --- /dev/null +++ b/demos/scons-embind/test.js @@ -0,0 +1,2 @@ +var thelibrary = require('./build/thelibrary.js'); +thelibrary.Module.print_some_stuff(1, 2, 'hello world'); diff --git a/docs/paper.pdf b/docs/paper.pdf index 401162ace9048..fc8ecf7cc5b91 100644 Binary files a/docs/paper.pdf and b/docs/paper.pdf differ diff --git a/docs/paper.tex b/docs/paper.tex index 3b8da61844c56..9e460bac36def 100644 --- a/docs/paper.tex +++ b/docs/paper.tex @@ -214,7 +214,7 @@ \section{Compilation Approach} int main() { int sum = 0; - for (int i = 1; i < 100; i++) + for (int i = 1; i <= 100; i++) sum += i; printf("1+...+100=%d\n", sum); return 0; @@ -239,7 +239,7 @@ \section{Compilation Approach} ;