diff options
-rw-r--r-- | src/analyzer.js | 2 | ||||
-rw-r--r-- | src/intertyper.js | 4 | ||||
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/parseTools.js | 2 | ||||
-rw-r--r-- | tests/runner.py | 12 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 526d0249..b43711d1 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -590,7 +590,7 @@ function analyzer(data) { if (param.intertype === 'value' && isNumber(param.ident)) { var corrected = parseInt(param.ident)/(fatSize/slimSize); assert(corrected % 1 === 0); - param.ident = param.value.text = corrected.toString(); + param.ident = corrected.toString(); } }); } else if (item.params) { diff --git a/src/intertyper.js b/src/intertyper.js index f3d68ac4..341b2e1d 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -388,7 +388,7 @@ function intertyper(data, sidePass, baseLineNums) { // Handle a single segment (after comma separation) function handleSegment(segment) { if (segment[1].text == 'null') { - return { intertype: 'value', value: 0, type: 'i32' }; + return { intertype: 'value', ident: '0', type: 'i32' }; } else if (segment[1].text == 'zeroinitializer') { Types.needAnalysis[segment[0].text] = 0; return { intertype: 'emptystruct', type: segment[0].text }; @@ -405,7 +405,7 @@ function intertyper(data, sidePass, baseLineNums) { return { intertype: 'list', type: segment[0].text, contents: handleSegments(segment[1].item.tokens) }; } else if (segment.length == 2) { Types.needAnalysis[segment[0].text] = 0; - return { intertype: 'value', type: segment[0].text, value: toNiceIdent(segment[1].text) }; + return { intertype: 'value', type: segment[0].text, ident: toNiceIdent(segment[1].text) }; } else if (segment[1].text === 'c') { // string var text = segment[2].text; diff --git a/src/jsifier.js b/src/jsifier.js index b02164f6..98460492 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -200,7 +200,7 @@ function JSify(data, functionsOnly, givenFunctions) { function handleSegment(segment) { var ret; if (segment.intertype === 'value') { - ret = segment.value.toString(); + ret = segment.ident; } else if (segment.intertype === 'emptystruct') { ret = makeEmptyStruct(segment.type); } else if (segment.intertype in PARSABLE_LLVM_FUNCTIONS) { diff --git a/src/parseTools.js b/src/parseTools.js index 024026c8..d0193a12 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -334,7 +334,6 @@ function parseParamTokens(params) { ret.push({ intertype: 'value', type: segment[0].text, - value: null, ident: toNiceIdent('%') + anonymousIndex }); Types.needAnalysis[ret[ret.length-1].type] = 0; @@ -355,7 +354,6 @@ function parseParamTokens(params) { ret.push({ intertype: 'value', type: segment[0].text, - value: segment[1], ident: toNiceIdent(parseNumerical(segment[1].text)) }); Types.needAnalysis[removeAllPointing(ret[ret.length-1].type)] = 0; diff --git a/tests/runner.py b/tests/runner.py index 9a430037..cdb2309b 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4872,15 +4872,17 @@ TT = %s # TODO: make sure all of these match gcc # TODO: when this is done, more test runner to test these (i.e., test all -Ox thoroughly) # -- options: check these, warn about errors. valid gcc ones are help, version. Ours should be -- too, not -. - # emcc src.cpp ==> should give a .js file + # emcc src.cpp or emcc src.cpp -o src.js ==> should give a .js file + # emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file + # emcc src.cpp -o src.html ==> should embed the js in an html file for immediate running on the web. only tricky part is sdl # emcc -O0 src.cpp ==> same as without -O0: assertions, etc., and greatest chance of code working: i64 1, ta2, etc., micro-opts - # emcc -O1 src.cpp ==> no assertions, plus eliminator, plus closure compiler (warn about closure compiler stuff) + # emcc -O1 src.cpp ==> no assertions, plus eliminator, plus js optimizer # emcc -O2 src.cpp ==> plus reloop (warn about speed) - # emcc -O3 src.cpp ==> no corrections, relax some other stuff like i64 1 into 0, etc.: dangerous stuff, warn, suggest -O2! + # emcc -O3 src.cpp ==> no corrections, relax some other stuff like i64 1 into 0, etc., do closure: dangerous stuff, warn, suggest -O2! # emcc --typed-arrays=x .. ==> should use typed arrays. default should be 2 # emcc --llvm-opts=x .. ==> pick level of LLVM optimizations (default is 0, to be safe?) - # emcc src.cpp -c ==> should give a .bc file - # linking - TODO + # When doing unsafe opts, can we run -Ox on the source, not just at the very end? + # linking - TODO. in particular, test normal project linking, static and dynamic: get_library should not need to be told what to link! # annotate each .bc with emscripten info, like "compiled with -O2: do the O2 opts when going to final .js" # warn if linking files with different annotations etc. # use llvm metadata, example: !0 = metadata !{i32 720913, i32 0, i32 4, metadata !"/dev/shm/tmp/src.cpp", metadata !"/dev/shm/tmp", metadata !"clang version 3.0 (tags/RELEASE_30/rc3)", i1 true, i1 false, metadata !"EMSCRIPTEN:O3", i32 0, metadata !1, metadata !1, metadata !3, metadata !1} ; [ DW_TAG_compile_unit ] |