diff options
author | alon@honor <none@none> | 2010-10-08 23:13:13 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-08 23:13:13 -0700 |
commit | f209c923ca69d6d1cdcd25e71a62afc133bbdc8d (patch) | |
tree | 5d7c05ab3efd93c0b1df063eee6501b9be095d86 /src | |
parent | 597a3dc5c2c02aca72df52e6e06002b510b7453a (diff) |
add entry labels only when necessary | all tests pass but fasta on clang
Diffstat (limited to 'src')
-rw-r--r-- | src/analyzer.js | 11 | ||||
-rw-r--r-- | src/intertyper.js | 9 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 6a97bb50..47c7281b 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -40,6 +40,15 @@ function analyzer(data) { subItem.endLineNum = null; subItem.lines = []; subItem.labels = []; + + // no explicit 'entry' label in clang on LLVM 2.8 - most of the time, but not all the time! - so we add one if necessary + if (LLVM_STYLE == 'new' && item.items[i+1].intertype !== 'label') { + item.items.splice(i+1, 0, { + intertype: 'label', + ident: '%entry', + lineNum: subItem.lineNum + '.5', + }); + } } else if (subItem.intertype == 'functionEnd') { item.functions.slice(-1)[0].endLineNum = subItem.lineNum; } else if (subItem.intertype == 'label') { @@ -638,7 +647,7 @@ function analyzer(data) { func.labels.forEach(function(label) { func.labelsDict[label.ident] = label; }); - func.block = makeBlock(func.labels, [toNiceIdent('%entry')], func.labelsDict); + func.block = makeBlock(func.labels, [toNiceIdent(func.labels[0].ident)], func.labelsDict); }); return finish(); diff --git a/src/intertyper.js b/src/intertyper.js index cdb11aef..88099202 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -298,15 +298,6 @@ function intertyper(data) { params: item.tokens[2], lineNum: item.lineNum, }]; - if (LLVM_STYLE == 'new') { - // no explicit 'entry' label in clang on LLVM 2.8, so we add one - ret.push({ - __result__: true, - intertype: 'label', - ident: '%entry', - lineNum: item.lineNum + '.5', - }); - } return ret; }, }); |