diff --git a/lib/IRGen/TypeLayout.cpp b/lib/IRGen/TypeLayout.cpp index 5ef1e9fbd1f60..45d9b515c88eb 100644 --- a/lib/IRGen/TypeLayout.cpp +++ b/lib/IRGen/TypeLayout.cpp @@ -15,6 +15,7 @@ #include "FixedTypeInfo.h" #include "GenOpaque.h" #include "IRGen.h" +#include "GenEnum.h" #include "GenExistential.h" #include "GenericArguments.h" #include "IRGenFunction.h" @@ -510,7 +511,8 @@ llvm::Function *createFixedEnumLoadTag(IRGenModule &IGM, auto castEnumPtr = IGF.Builder.CreateBitCast(enumPtr, enumType); auto enumAddr = typeInfo->getAddressForPointer(castEnumPtr); - auto tag = entry.getEnumTag(IGF, enumAddr); + auto &strategy = getEnumImplStrategy(IGM, entry.ty); + auto tag = strategy.emitGetEnumTag(IGF, entry.ty, enumAddr); IGF.Builder.CreateRet(tag); }); diff --git a/test/Interpreter/Inputs/layout_string_witnesses_types.swift b/test/Interpreter/Inputs/layout_string_witnesses_types.swift index 5847702ce5195..3b6d2eee1ef83 100644 --- a/test/Interpreter/Inputs/layout_string_witnesses_types.swift +++ b/test/Interpreter/Inputs/layout_string_witnesses_types.swift @@ -450,7 +450,7 @@ public enum SinglePayloadEnumManyXI { case empty4 case empty5 case empty6 - case nonEmpty(Builtin.Int127, SimpleClass) + case nonEmpty(Builtin.Int63, SimpleClass) } public struct PrespecializedStruct { diff --git a/test/Interpreter/layout_string_witnesses_static.swift b/test/Interpreter/layout_string_witnesses_static.swift index b90a89623334a..c612445152503 100644 --- a/test/Interpreter/layout_string_witnesses_static.swift +++ b/test/Interpreter/layout_string_witnesses_static.swift @@ -1,8 +1,8 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -enable-experimental-feature LayoutStringValueWitnesses -enable-layout-string-value-witnesses -enable-type-layout -parse-stdlib -emit-module -emit-module-path=%t/layout_string_witnesses_types.swiftmodule %S/Inputs/layout_string_witnesses_types.swift +// RUN: %target-swift-frontend -enable-experimental-feature LayoutStringValueWitnesses -enable-layout-string-value-witnesses -parse-stdlib -emit-module -emit-module-path=%t/layout_string_witnesses_types.swiftmodule %S/Inputs/layout_string_witnesses_types.swift // NOTE: We have to build this as dylib to turn private external symbols into local symbols, so we can observe potential issues with linkage -// RUN: %target-build-swift-dylib(%t/%target-library-name(layout_string_witnesses_types)) -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -enable-type-layout -Xfrontend -parse-stdlib -parse-as-library %S/Inputs/layout_string_witnesses_types.swift +// RUN: %target-build-swift-dylib(%t/%target-library-name(layout_string_witnesses_types)) -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -parse-stdlib -parse-as-library %S/Inputs/layout_string_witnesses_types.swift // RUN: %target-codesign %t/%target-library-name(layout_string_witnesses_types) // RUN: %target-swift-frontend -enable-experimental-feature LayoutStringValueWitnesses -enable-layout-string-value-witnesses -enable-library-evolution -emit-module -emit-module-path=%t/layout_string_witnesses_types_resilient.swiftmodule %S/Inputs/layout_string_witnesses_types_resilient.swift // RUN: %target-build-swift -g -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -enable-library-evolution -c -parse-as-library -o %t/layout_string_witnesses_types_resilient.o %S/Inputs/layout_string_witnesses_types_resilient.swift