SIL: Introduce a SILConstant type.

We need something more general than ValueDecl to be able to talk about anonymous functions, curried entry points, etc. as SIL constants. SILConstant is a (ValueDecl | CapturingExpr) union with an additional index for discriminating multiple instances or entry points derived from the same AST entity. Update ConstantInst and SILModule's function table to be keyed by SILConstant rather than ValueDecl.

Swift SVN r3372
This commit is contained in:
Joe Groff
2012-12-05 22:40:38 +00:00
parent 1f45f28837
commit a593076d09
12 changed files with 156 additions and 64 deletions

View File

@@ -75,8 +75,9 @@ public:
}
void visitConstantRefInst(ConstantRefInst *DRI) {
assert(isa<VarDecl>(DRI->getDecl()) == DRI->getType()->is<LValueType>()
&& "ConstantRef should only produce an lvalue for global var decls");
assert(DRI->getConstant().getType()->getCanonicalType() ==
DRI->getType()->getCanonicalType()
&& "ConstantRef type does not match constant's type");
}
void visitIntegerLiteralInst(IntegerLiteralInst *ILI) {