Skip to content

Commit

Permalink
cli: --print-hir, --print-lir
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Nov 6, 2012
1 parent 63fb954 commit 6d64155
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 4 additions & 2 deletions candor.io.gyp
Expand Up @@ -14,7 +14,7 @@
'dependencies': [ 'dependencies': [
'deps/candor/candor.gyp:candor', 'deps/candor/candor.gyp:candor',
'deps/uv/uv.gyp:libuv', 'deps/uv/uv.gyp:libuv',
'can2c_scripts' 'can2c_scripts#host'
], ],
'include_dirs': [ 'include_dirs': [
'deps/candor/include', 'deps/candor/include',
Expand All @@ -40,14 +40,16 @@
] ]
}, { }, {
'target_name': 'can2c', 'target_name': 'can2c',
'toolsets': [ 'host' ],
'type': 'executable', 'type': 'executable',
'sources': [ 'sources': [
'tools/can2c.cc' 'tools/can2c.cc'
], ],
}, { }, {
'target_name': 'can2c_scripts', 'target_name': 'can2c_scripts',
'toolsets': [ 'host' ],
'type': 'none', 'type': 'none',
'dependencies': [ 'can2c' ], 'dependencies': [ 'can2c#host' ],
'actions': [{ 'actions': [{
'action_name': 'can2c', 'action_name': 'can2c',
'inputs': [ 'inputs': [
Expand Down
2 changes: 1 addition & 1 deletion deps/uv
Submodule uv updated 1 files
+3 −1 test/test-spawn.c
12 changes: 10 additions & 2 deletions src/process.cc
@@ -1,4 +1,5 @@
#include <candor.h> #include <candor.h>
#include <string.h> // strncmp
#include "process.h" #include "process.h"
#include "runtime.h" #include "runtime.h"


Expand All @@ -10,11 +11,18 @@ void InitProcess(int argc, char** argv) {
Object* process = Object::New(); Object* process = Object::New();
Array* aargv = Array::New(); Array* aargv = Array::New();


int j = 0;
for (int i = 0; i < argc; i++) { for (int i = 0; i < argc; i++) {
aargv->Set(i, String::New(argv[i])); if (strcmp(argv[i], "--print-hir") == 0) {
Isolate::EnableHIRLogging();
} else if (strcmp(argv[i], "--print-lir") == 0) {
Isolate::EnableLIRLogging();
} else {
aargv->Set(j++, String::New(argv[i]));
}
} }


process->Set("argc", Number::NewIntegral(argc)); process->Set("argc", Number::NewIntegral(j));
process->Set("argv", aargv); process->Set("argv", aargv);


GetRuntime()->Set("process", process); GetRuntime()->Set("process", process);
Expand Down

0 comments on commit 6d64155

Please sign in to comment.