aboutsummaryrefslogtreecommitdiff
path: root/src/intertyper.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-03 14:06:11 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-03 14:06:11 -0800
commit4edb36d31bb553b07c46b44d2c8f28ed27421bb5 (patch)
treed43458ad08939638cb42d2a5182ce987c0817034 /src/intertyper.js
parent4bf23981037b66af07ddf9ee9b089a9f2b62b2a1 (diff)
optimize metadata parsing
Diffstat (limited to 'src/intertyper.js')
-rw-r--r--src/intertyper.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 417a4f21..86da2a1f 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -11,28 +11,28 @@ function tokenize(text) {
function intertyper(data, sidePass, baseLineNum) {
var mainPass = !sidePass;
- dprint('framework', 'Big picture: Starting intertyper, main pass=' + mainPass);
-
baseLineNum = baseLineNum || 0;
- // Substrate
+ dprint('framework', 'Big picture: Starting intertyper, main pass=' + mainPass);
- if (LLVM_STYLE === null) {
- // new = clang on 2.8, old = llvm-gcc anywhere or clang on 2.7
- LLVM_STYLE = (data.indexOf('<label>') == -1 && data.indexOf('entry:') != -1) ? 'old' : 'new';
- //dprint('LLVM_STYLE: ' + LLVM_STYLE);
- }
+ if (mainPass) {
+ if (LLVM_STYLE === null) {
+ // new = clang on 2.8, old = llvm-gcc anywhere or clang on 2.7
+ LLVM_STYLE = (data.indexOf('<label>') == -1 && data.indexOf('entry:') != -1) ? 'old' : 'new';
+ //dprint('LLVM_STYLE: ' + LLVM_STYLE);
+ }
- // If the source contains debug info as LLVM metadata, process that out (and save the debugging info for later)
- for (var i = data.length-1; i >= 0; i--) {
- if (/^!\d+ = metadata .*/.exec(data[i])) {
- data = Debugging.processMetadata(data);
- //print(data.join('\n'));
- //dprint(JSON.stringify(Debugging));
- break;
+ // If the source contains debug info as LLVM metadata, process that out (and save the debugging info for later)
+ for (var i = data.length-1; i >= 0; i--) {
+ if (/^!\d+ = metadata .*/.exec(data[i])) {
+ Debugging.processMetadata(data);
+ break;
+ }
}
}
+ // Substrate
+
var substrate = new Substrate('Intertyper');
// Line splitter. We break off some bunches of lines into unparsedBundles, which are