Skip to content

Commit

Permalink
remove exit-afterwards? arg from impc:aot:compile-xtm-file
Browse files Browse the repository at this point in the history
who ever used it?  and several of the callsites were wrong
  • Loading branch information
benswift committed May 30, 2016
1 parent 87b8ec4 commit e9fe7ac
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -603,13 +603,13 @@ else(WIN32)
if(PACKAGE)
add_custom_target(${targetname}
COMMAND extempore --nobase --noaudio --mcpu=generic --attr=none --port=${EXTEMPORE_AOT_COMPILE_PORT}
--eval "(impc:aot:compile-xtm-file \"${libfile}\" #t #t)"
--eval "(impc:aot:compile-xtm-file \"${libfile}\")"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM)
else(PACKAGE)
add_custom_target(${targetname}
COMMAND extempore --nobase --noaudio --port=${EXTEMPORE_AOT_COMPILE_PORT}
--eval "(impc:aot:compile-xtm-file \"${libfile}\" #t #t)"
--eval "(impc:aot:compile-xtm-file \"${libfile}\")"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM)
endif(PACKAGE)
Expand Down
2 changes: 1 addition & 1 deletion compile-stdlib.sh
Expand Up @@ -39,7 +39,7 @@ echo
# check all the required shared libs are there
for f in $AOT_LIBS
do
$AOT_COMPILATION_COMMAND "(impc:aot:compile-xtm-file \"$f\" #t #t)"
$AOT_COMPILATION_COMMAND "(impc:aot:compile-xtm-file \"$f\" #t)"
rc=$?
if (($rc != 0)) ; then
echo -e "\033[0;31mError AOT-compiling $f\033[0;00m"
Expand Down
4 changes: 2 additions & 2 deletions extras/cmake/aot.cmake.in
Expand Up @@ -17,13 +17,13 @@ foreach(aot-lib ${AOT_LIBS})
if(PACKAGE)
# pass --attr=none when packaging
execute_process(
COMMAND ./extempore --nobase --attr=none --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\" #t #t)"
COMMAND ./extempore --nobase --attr=none --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\")"
WORKING_DIRECTORY @CMAKE_SOURCE_DIR@
TIMEOUT 900 # 15 minutes
RESULT_VARIABLE aot_retval)
else(PACKAGE)
execute_process(
COMMAND ./extempore --nobase --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\" #t #t)"
COMMAND ./extempore --nobase --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\")"
WORKING_DIRECTORY @CMAKE_SOURCE_DIR@
TIMEOUT 900 # 15 minutes
RESULT_VARIABLE aot_retval)
Expand Down
4 changes: 2 additions & 2 deletions extras/cmake/aot_extended.cmake.in
Expand Up @@ -32,13 +32,13 @@ foreach(aot-lib ${AOT_LIBS})
if(PACKAGE)
# pass --attr=none when packaging
execute_process(
COMMAND ./extempore --nobase --attr=none --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\" #t #t)"
COMMAND ./extempore --nobase --attr=none --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\")"
WORKING_DIRECTORY @CMAKE_SOURCE_DIR@
TIMEOUT 900 # 15 minutes
RESULT_VARIABLE aot_retval)
else(PACKAGE)
execute_process(
COMMAND ./extempore --nobase --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\" #t #t)"
COMMAND ./extempore --nobase --port 17099 --eval "(impc:aot:compile-xtm-file \"${aot-lib}\")"
WORKING_DIRECTORY @CMAKE_SOURCE_DIR@
TIMEOUT 900 # 15 minutes
RESULT_VARIABLE aot_retval)
Expand Down
16 changes: 8 additions & 8 deletions runtime/llvmti.xtm
Expand Up @@ -2761,7 +2761,7 @@
(begin ,@forms)))

(define impc:aot:compile-module
(lambda (module-name module exit-afterwards?)
(lambda (module-name module)
(let* ((llc-path (sanitize-platform-path (string-append (get-llvm-path) "/bin/llc"))))
(let* ((platform (sys:platform))
(tmp-dir (unix-or-Windows "/tmp/extempore/" (string-append (sys:command-output "echo %TEMP%") "\\extempore\\")))
Expand Down Expand Up @@ -2835,15 +2835,15 @@
(if (<> llc-res 0)
(begin (print-with-colors 'red 'default #t
(print "llc command failed with exit code " llc-res "\n"))
(if exit-afterwards? (quit 1))))
(quit 1)))
(begin
(print-with-colors 'black 'yellow #t (print " Compiling native shared library "))
(print "\n " link-command "\n\n"))
(set! linker-res (sys:command link-command))
(if (<> linker-res 0)
(begin (print-with-colors 'red 'default #t
(print "linking failed with exit code " linker-res "\n"))
(if exit-afterwards? (quit 1)))
(quit 1))
(begin
(print-with-colors 'black 'green #t (print " Succesfully compiled "))
(print "\n " output-shlib-path "\n\n"))))))))
Expand Down Expand Up @@ -2939,7 +2939,7 @@
(Windows-add-libdir-to-PATH))

(define impc:aot:compile-xtm-file
(lambda (lib-path exit-afterwards?)
(lambda (lib-path)
(let ((start-time (now))
(in-file-port (or
(open-input-file (sanitize-platform-path lib-path))
Expand Down Expand Up @@ -2988,7 +2988,7 @@
(let ((module (impc:compiler:flush-jit-compilation-queue)))
(if (not module)
(impc:compiler:print-compiler-error "Failed compiling LLVM IR"))
(impc:aot:compile-module libname-no-extension module exit-afterwards?))
(impc:aot:compile-module libname-no-extension module))
;; (impc:aot:insert-footer libname-no-extension)
(close-port *impc:aot:current-output-port*)
(set! *impc:aot:current-lib-name* "xtmdylib")
Expand All @@ -2997,15 +2997,15 @@
(print "Successfully wrote AOT-compilation file to ")
(print-with-colors 'green 'default #f (print aot-compilation-file-path "\n\n"))
(impc:aot:print-compilation-details start-time)
(if exit-afterwards? (quit 0)))
(quit 0))
(begin (print-with-colors 'black 'red #t (print " Error "))
(print "\n\nsomething went wrong in writing the output file ")
(print-with-colors 'red 'faultde #t (print aot-compilation-file-path "\n"))
(if exit-afterwards? (quit 1)))))
(quit 1))))
(begin (print-with-colors 'black 'red #t
(print " Error "))
(print "\n\ncannot write AOT-compilation file at " aot-compilation-file-path "\n")
(if exit-afterwards? (quit 2)))))))))))
(quit 2))))))))))


(define icr:new-zone
Expand Down
2 changes: 1 addition & 1 deletion tests/core/aot-compilation.xtm
Expand Up @@ -9,7 +9,7 @@
;; to run these tests, first precompile the test library. In a shell
;; in the Extempore directory,

;; extempore --eval "(impc:aot:compile-xtm-file \"libs/contrib/aot-compilation.xtm\" #t #t)"
;; extempore --eval "(impc:aot:compile-xtm-file \"libs/contrib/aot-compilation.xtm\")"

;;; Code:

Expand Down

0 comments on commit e9fe7ac

Please sign in to comment.