SIL Parser: parse initialize_var.

Swift SVN r6294
This commit is contained in:
Manman Ren
2013-07-16 20:30:10 +00:00
parent 0a19b8e4e3
commit b9444e587c
2 changed files with 22 additions and 0 deletions

View File

@@ -757,6 +757,7 @@ bool SILParser::parseSILOpcode(ValueKind &Opcode, SourceLoc &OpcodeLoc,
.Case("downcast_archetype_addr", ValueKind::DowncastArchetypeAddrInst)
.Case("downcast_archetype_ref", ValueKind::DowncastArchetypeRefInst)
.Case("downcast_existential_ref", ValueKind::DowncastExistentialRefInst)
.Case("initialize_var", ValueKind::InitializeVarInst)
.Case("integer_literal", ValueKind::IntegerLiteralInst)
.Case("function_ref", ValueKind::FunctionRefInst)
.Case("load", ValueKind::LoadInst)
@@ -1270,6 +1271,14 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB) {
IsTake);
break;
}
case ValueKind::InitializeVarInst: {
bool NoDefault = false;
if (parseSILOptional(NoDefault, P, "no_default_construct") ||
parseTypedValueRef(Val))
return true;
ResultVal = B.createInitializeVar(SILLocation(), Val, !NoDefault);
break;
}
}
setLocalValue(ResultVal, ResultName, ResultNameLoc);