Permalink
Browse files

cli: --print-hir, --print-lir

  • Loading branch information...
1 parent 63fb954 commit 6d6415588a19de6a8ea3d6b07e619c3f270e03cf @indutny committed Nov 6, 2012
Showing with 16 additions and 6 deletions.
  1. +4 −2 candor.io.gyp
  2. +1 −1 deps/candor
  3. +1 −1 deps/uv
  4. +10 −2 src/process.cc
View
@@ -14,7 +14,7 @@
'dependencies': [
'deps/candor/candor.gyp:candor',
'deps/uv/uv.gyp:libuv',
- 'can2c_scripts'
+ 'can2c_scripts#host'
],
'include_dirs': [
'deps/candor/include',
@@ -40,14 +40,16 @@
]
}, {
'target_name': 'can2c',
+ 'toolsets': [ 'host' ],
'type': 'executable',
'sources': [
'tools/can2c.cc'
],
}, {
'target_name': 'can2c_scripts',
+ 'toolsets': [ 'host' ],
'type': 'none',
- 'dependencies': [ 'can2c' ],
+ 'dependencies': [ 'can2c#host' ],
'actions': [{
'action_name': 'can2c',
'inputs': [
Submodule uv updated 1 files
+3 −1 test/test-spawn.c
View
@@ -1,4 +1,5 @@
#include <candor.h>
+#include <string.h> // strncmp
#include "process.h"
#include "runtime.h"
@@ -10,11 +11,18 @@ void InitProcess(int argc, char** argv) {
Object* process = Object::New();
Array* aargv = Array::New();
+ int j = 0;
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);
GetRuntime()->Set("process", process);

0 comments on commit 6d64155

Please sign in to comment.