aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-18 14:54:33 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-18 14:54:33 -0800
commit067f13f4c89c35011c722cd8441bbf1a1ffe4543 (patch)
treed56ac5adee8488494eb3f3558401b33b10b47498 /src/analyzer.js
parent42b3bb7206356f6543737696d3bbd75ebe2aad4f (diff)
support switches to phi
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index c5d1d405..c8e31dea 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -628,7 +628,7 @@ function analyzer(data) {
var sourceLabelId = phi.params[i].label;
var sourceLabel = func.labelsDict[sourceLabelId];
var lastLine = sourceLabel.lines.slice(-1)[0];
- assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
+ assert(lastLine.intertype in LLVM.BRANCHINGS, 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
lastLine.currLabelId = sourceLabelId;
}
phis.push(line);
@@ -671,7 +671,7 @@ function analyzer(data) {
var sourceLabelId = param.label;
var sourceLabel = func.labelsDict[sourceLabelId];
var lastLine = sourceLabel.lines.slice(-1)[0];
- assert(lastLine.intertype == 'branch', 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
+ assert(lastLine.intertype in LLVM.BRANCHINGS, 'Only branches can lead to labels with phis, line ' + [func.ident, label.ident]);
if (!lastLine.phi) {
// We store the phi assignments in the branch's params (which are otherwise unused)
lastLine.phi = true;