From 0e2f1abf5b764a4a3928a2f4f050144063c46a93 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Sun, 6 Mar 2022 23:47:27 -0800 Subject: cmd/compile: represent derived types with ir.DynamicType in unified IR This CL switches unified IR to using ir.DynamicType for derived types. This has an immediate effect of fixing compilation of generic code that when fully stenciled results in statically invalid type assertions. This does require updating typecheck to expect ODYNAMICTYPE in type switches, but this is straightforward to implement. For now, we still statically resolve the runtime type (or itab) pointer. However, a subsequent CL will allow reading these pointers from the runtime dictionary. Change-Id: I1666678fcc588bc9cb8b97871bd02b9059848e6d Reviewed-on: https://go-review.googlesource.com/c/go/+/390336 Trust: Matthew Dempsky Run-TryBot: Matthew Dempsky TryBot-Result: Gopher Robot Reviewed-by: Cuong Manh Le --- src/internal/pkgbits/syncmarker_string.go | 61 ++++++++++++++++--------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src/internal/pkgbits/syncmarker_string.go') diff --git a/src/internal/pkgbits/syncmarker_string.go b/src/internal/pkgbits/syncmarker_string.go index 91154a001d..39db9eddad 100644 --- a/src/internal/pkgbits/syncmarker_string.go +++ b/src/internal/pkgbits/syncmarker_string.go @@ -44,39 +44,40 @@ func _() { _ = x[SyncExprList-34] _ = x[SyncExprs-35] _ = x[SyncExpr-36] - _ = x[SyncOp-37] - _ = x[SyncFuncLit-38] - _ = x[SyncCompLit-39] - _ = x[SyncDecl-40] - _ = x[SyncFuncBody-41] - _ = x[SyncOpenScope-42] - _ = x[SyncCloseScope-43] - _ = x[SyncCloseAnotherScope-44] - _ = x[SyncDeclNames-45] - _ = x[SyncDeclName-46] - _ = x[SyncStmts-47] - _ = x[SyncBlockStmt-48] - _ = x[SyncIfStmt-49] - _ = x[SyncForStmt-50] - _ = x[SyncSwitchStmt-51] - _ = x[SyncRangeStmt-52] - _ = x[SyncCaseClause-53] - _ = x[SyncCommClause-54] - _ = x[SyncSelectStmt-55] - _ = x[SyncDecls-56] - _ = x[SyncLabeledStmt-57] - _ = x[SyncUseObjLocal-58] - _ = x[SyncAddLocal-59] - _ = x[SyncLinkname-60] - _ = x[SyncStmt1-61] - _ = x[SyncStmtsEnd-62] - _ = x[SyncLabel-63] - _ = x[SyncOptLabel-64] + _ = x[SyncExprType-37] + _ = x[SyncOp-38] + _ = x[SyncFuncLit-39] + _ = x[SyncCompLit-40] + _ = x[SyncDecl-41] + _ = x[SyncFuncBody-42] + _ = x[SyncOpenScope-43] + _ = x[SyncCloseScope-44] + _ = x[SyncCloseAnotherScope-45] + _ = x[SyncDeclNames-46] + _ = x[SyncDeclName-47] + _ = x[SyncStmts-48] + _ = x[SyncBlockStmt-49] + _ = x[SyncIfStmt-50] + _ = x[SyncForStmt-51] + _ = x[SyncSwitchStmt-52] + _ = x[SyncRangeStmt-53] + _ = x[SyncCaseClause-54] + _ = x[SyncCommClause-55] + _ = x[SyncSelectStmt-56] + _ = x[SyncDecls-57] + _ = x[SyncLabeledStmt-58] + _ = x[SyncUseObjLocal-59] + _ = x[SyncAddLocal-60] + _ = x[SyncLinkname-61] + _ = x[SyncStmt1-62] + _ = x[SyncStmtsEnd-63] + _ = x[SyncLabel-64] + _ = x[SyncOptLabel-65] } -const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabel" +const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprAssertTypeOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabel" -var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 220, 227, 234, 238, 246, 255, 265, 282, 291, 299, 304, 313, 319, 326, 336, 345, 355, 365, 375, 380, 391, 402, 410, 418, 423, 431, 436, 444} +var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 228, 230, 237, 244, 248, 256, 265, 275, 292, 301, 309, 314, 323, 329, 336, 346, 355, 365, 375, 385, 390, 401, 412, 420, 428, 433, 441, 446, 454} func (i SyncMarker) String() string { i -= 1 -- cgit v1.3-5-g9baa