-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix errors and warnings building swift/reflection on Windows with MSVC #6026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -452,6 +452,9 @@ class ReflectionContext | |||
case MetadataSourceKind::SelfWitnessTable: | |||
return true; | |||
} | |||
|
|||
std::cerr << "fatal error: " << "Unhandled MetadataSourceKind in switch." << "\n"; | |||
std::abort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better handled with a covered switch and an unreachable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get linker errors compiling swiftCore.dll if we use llvm_unreachable
. The errors are unresolved external llvm_unreachable_internal
. This is because we can't/don't link any LLVM libraries from the stdlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment about introducing a swift_unreachable
.
@@ -38,11 +38,11 @@ enum class TypeRefKind { | |||
|
|||
#define FIND_OR_CREATE_TYPEREF(Allocator, TypeRefTy, ...) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clang-format this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
@@ -772,6 +772,9 @@ class TypeRefVisitor { | |||
::std::forward<Args>(args)...); | |||
#include "swift/Reflection/TypeRefs.def" | |||
} | |||
|
|||
std::cerr << "fatal error: " << "Unhandled TypeRefKind in switch." << "\n"; | |||
std::abort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better handled with a covered switch and unreachable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Will update to use |
@compnerd updated, thanks |
return Entry->second; \ | ||
const auto TR = \ | ||
Allocator.DEPENDENT_TEMPLATE makeTypeRef<TypeRefTy>(__VA_ARGS__); \ | ||
Allocator.DEPENDENT_TEMPLATE TypeRefTy##s.insert({ID, TR}); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should file a SR to address this difference and try to unify the behavior once the compilers are updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swift-ci please test and merge |
Please retrigger the tests as they didn't get triggered, thanks! |
@swift-ci please test and merge |
template
qualifiers for non-template methods<io.h>
instead of POSIX's<unistd.h>
llvm_unreachable
as this is imported in thestdlib