summaryrefslogtreecommitdiff
path: root/Source/Predication
diff options
context:
space:
mode:
authorGravatar Ally Donaldson <unknown>2013-07-22 18:05:27 +0100
committerGravatar Ally Donaldson <unknown>2013-07-22 18:05:27 +0100
commitafaeb081ffcc1c258db6eb7c34ba0b04c493919a (patch)
treed0b07c3e3082f323e17523a3e695dc18ee61062d /Source/Predication
parent858d43ff93a0cc9bc30ce55906499fb9157124c9 (diff)
More refactoring towards replacing PureCollections.Sequence with List
Diffstat (limited to 'Source/Predication')
-rw-r--r--Source/Predication/BlockPredicator.cs2
-rw-r--r--Source/Predication/SmartBlockPredicator.cs8
2 files changed, 5 insertions, 5 deletions
diff --git a/Source/Predication/BlockPredicator.cs b/Source/Predication/BlockPredicator.cs
index 83be688e..eac60511 100644
--- a/Source/Predication/BlockPredicator.cs
+++ b/Source/Predication/BlockPredicator.cs
@@ -76,7 +76,7 @@ public class BlockPredicator {
// This may be a loop invariant. Make sure it continues to appear as
// the first statement in the block.
var assign = cmdSeq.Last();
- cmdSeq.Truncate(cmdSeq.Length-1);
+ cmdSeq.RemoveAt(cmdSeq.Count-1);
Expr newExpr = new EnabledReplacementVisitor(pExpr).VisitExpr(aCmd.Expr);
aCmd.Expr = QKeyValue.FindBoolAttribute(aCmd.Attributes, "do_not_predicate") ? newExpr : Expr.Imp(pExpr, newExpr);
cmdSeq.Add(aCmd);
diff --git a/Source/Predication/SmartBlockPredicator.cs b/Source/Predication/SmartBlockPredicator.cs
index 55e73161..9dc10d02 100644
--- a/Source/Predication/SmartBlockPredicator.cs
+++ b/Source/Predication/SmartBlockPredicator.cs
@@ -146,13 +146,13 @@ public class SmartBlockPredicator {
hasPredicatedRegion = hasPredicatedRegion ||
gCmd.labelTargets.Cast<Block>().Any(b => predMap.ContainsKey(b));
- if (gCmd.labelTargets.Length == 1) {
+ if (gCmd.labelTargets.Count == 1) {
if (defMap.ContainsKey(gCmd.labelTargets[0]))
PredicateCmd(p, cmdSeq,
Cmd.SimpleAssign(Token.NoToken,
Expr.Ident(predMap[gCmd.labelTargets[0]]), Expr.True));
} else {
- Debug.Assert(gCmd.labelTargets.Length > 1);
+ Debug.Assert(gCmd.labelTargets.Count > 1);
Debug.Assert(gCmd.labelTargets.Cast<Block>().All(t => uni.IsUniform(impl.Name, t) ||
partInfo.ContainsKey(t)));
foreach (Block target in gCmd.labelTargets) {
@@ -353,9 +353,9 @@ public class SmartBlockPredicator {
}
Block realDest = block;
- if (block.Cmds.Length == 0) {
+ if (block.Cmds.Count == 0) {
var gc = block.TransferCmd as GotoCmd;
- if (gc != null && gc.labelTargets.Length == 1)
+ if (gc != null && gc.labelTargets.Count == 1)
realDest = gc.labelTargets[0];
}
partInfo[block] = new PartInfo(pred, realDest);