mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user