aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-20 16:48:58 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-20 16:48:58 -0800
commit22b996181d14580413f720703b68b15a7270dd41 (patch)
treefba1b6895c81b8033a968e1cb00b31df91b9049d /src/compiler.js
parent954e3a1fc346d7f3b6cb35a9953db3d8e835cecf (diff)
hack up support for 'glue' phase in js compiler, to just generate glue for backend output
Diffstat (limited to 'src/compiler.js')
-rw-r--r--src/compiler.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler.js b/src/compiler.js
index f523022b..7d768c3d 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -267,7 +267,7 @@ function compile(raw) {
function runPhase(currPhase) {
//printErr('// JS compiler in action, phase ' + currPhase + typeof lines + (lines === null));
phase = currPhase;
- if (phase != 'pre') {
+ if (phase != 'pre' && phase != 'glue') {
if (singlePhase) PassManager.load(read(forwardedDataFile));
if (phase == 'funcs') {
@@ -313,7 +313,9 @@ B = new Benchmarker();
try {
if (ll_file) {
- if (ll_file.indexOf(String.fromCharCode(10)) == -1) {
+ if (phase === 'glue') {
+ compile(';');
+ } else if (ll_file.indexOf(String.fromCharCode(10)) == -1) {
compile(read(ll_file));
} else {
compile(ll_file); // we are given raw .ll