|
25 | 25 | #include "swift/Runtime/Casting.h"
|
26 | 26 | #include "swift/Runtime/Concurrent.h"
|
27 | 27 | #include "swift/Runtime/Debug.h"
|
| 28 | +#include "swift/Runtime/EnvironmentVariables.h" |
28 | 29 | #include "swift/Runtime/HeapObject.h"
|
29 | 30 | #include "swift/Runtime/Metadata.h"
|
30 | 31 | #include "swift/Strings.h"
|
@@ -1951,7 +1952,8 @@ swift_getTypeByMangledNameInEnvironment(
|
1951 | 1952 | [&substitutions](const Metadata *type, unsigned index) {
|
1952 | 1953 | return substitutions.getWitnessTable(type, index);
|
1953 | 1954 | });
|
1954 |
| - if (result.isError()) { |
| 1955 | + if (result.isError() |
| 1956 | + && runtime::environment::SWIFT_DEBUG_FAILED_TYPE_LOOKUP()) { |
1955 | 1957 | TypeLookupError *error = result.getError();
|
1956 | 1958 | char *errorString = error->copyErrorString();
|
1957 | 1959 | swift::warning(0, "failed type lookup for %.*s: %s\n",
|
@@ -1982,7 +1984,8 @@ swift_getTypeByMangledNameInEnvironmentInMetadataState(
|
1982 | 1984 | [&substitutions](const Metadata *type, unsigned index) {
|
1983 | 1985 | return substitutions.getWitnessTable(type, index);
|
1984 | 1986 | });
|
1985 |
| - if (result.isError()) { |
| 1987 | + if (result.isError() |
| 1988 | + && runtime::environment::SWIFT_DEBUG_FAILED_TYPE_LOOKUP()) { |
1986 | 1989 | TypeLookupError *error = result.getError();
|
1987 | 1990 | char *errorString = error->copyErrorString();
|
1988 | 1991 | swift::warning(0, "failed type lookup for %.*s: %s\n",
|
@@ -2012,7 +2015,8 @@ swift_getTypeByMangledNameInContext(
|
2012 | 2015 | [&substitutions](const Metadata *type, unsigned index) {
|
2013 | 2016 | return substitutions.getWitnessTable(type, index);
|
2014 | 2017 | });
|
2015 |
| - if (result.isError()) { |
| 2018 | + if (result.isError() |
| 2019 | + && runtime::environment::SWIFT_DEBUG_FAILED_TYPE_LOOKUP()) { |
2016 | 2020 | TypeLookupError *error = result.getError();
|
2017 | 2021 | char *errorString = error->copyErrorString();
|
2018 | 2022 | swift::warning(0, "failed type lookup for %.*s: %s\n",
|
@@ -2043,7 +2047,8 @@ swift_getTypeByMangledNameInContextInMetadataState(
|
2043 | 2047 | [&substitutions](const Metadata *type, unsigned index) {
|
2044 | 2048 | return substitutions.getWitnessTable(type, index);
|
2045 | 2049 | });
|
2046 |
| - if (result.isError()) { |
| 2050 | + if (result.isError() |
| 2051 | + && runtime::environment::SWIFT_DEBUG_FAILED_TYPE_LOOKUP()) { |
2047 | 2052 | TypeLookupError *error = result.getError();
|
2048 | 2053 | char *errorString = error->copyErrorString();
|
2049 | 2054 | swift::warning(0, "failed type lookup for %.*s: %s\n",
|
|
0 commit comments