Migrate to use new projection for COWArrayOpt. This should be a NFC.

This is part of rdar://24520269
This commit is contained in:
Xin Tong
2016-02-07 12:54:36 -08:00
parent 17e3f35758
commit d5dfe57e14
2 changed files with 62 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ COWViewCFGFunction("view-cfg-before-cow-for", llvm::cl::init(""),
/// either refer to the next element (indexed) or a subelement.
static SILValue getAccessPath(SILValue V, SmallVectorImpl<unsigned>& Path) {
V = stripCasts(V);
ProjectionIndex PI(V);
NewProjectionIndex PI(V);
if (!PI.isValid() || V->getKind() == ValueKind::IndexAddrInst)
return V;
@@ -201,7 +201,7 @@ protected:
continue;
}
ProjectionIndex PI(UseInst);
NewProjectionIndex PI(UseInst);
// Do not form a path from an IndexAddrInst without otherwise
// distinguishing it from subelement addressing.
if (!PI.isValid() || V->getKind() == ValueKind::IndexAddrInst) {