Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 6d6415588a19de6a8ea3d6b07e619c3f270e03cf 1 parent 63fb954
@indutny authored
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
6 candor.io.gyp
@@ -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': [
2  deps/candor
@@ -1 +1 @@
-Subproject commit 016cfef6656805a19f7a31082072fa685e00ddab
+Subproject commit 67d536d6859fea76426eb47fefcdecb5761860b4
2  deps/uv
@@ -1 +1 @@
-Subproject commit 0ddf9d6b98c32254b577d3d8516f7ba674222557
+Subproject commit 7759bd63cdad2e2b6065fe0786dff66afe761373
View
12 src/process.cc
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.