Skip to content

Commit 210d583

Browse files
committed
AST: remove ScalarTraits<size_t> on Windows
Because `size_t` is the same as `uint64_t` on Windows, this results in a conflicting definition of the `ScalarTraits`.
1 parent 4ee879e commit 210d583

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/swift/AST/ExperimentalDependencies.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,9 @@ template <typename GraphT> class DotFileEmitter {
939939
// MARK: Declarations for YAMLTraits for reading/writing of SourceFileDepGraph
940940
//==============================================================================
941941

942-
// This introduces a redefinition for Linux.
943-
#if !defined(__linux__)
942+
// This introduces a redefinition where ever std::is_same_t<size_t, uint64_t>
943+
// holds
944+
#if !(defined(__linux__) || defined(_WIN64))
944945
LLVM_YAML_DECLARE_SCALAR_TRAITS(size_t, QuotingType::None)
945946
#endif
946947
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::experimental_dependencies::NodeKind)

lib/AST/ExperimentalDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void SourceFileDepGraph::verifySame(const SourceFileDepGraph &other) const {
262262
namespace llvm {
263263
namespace yaml {
264264
// This introduces a redefinition for Linux.
265-
#if !defined(__linux__)
265+
#if !(defined(__linux__) || defined(_WIN64))
266266
void ScalarTraits<size_t>::output(const size_t &Val, void *, raw_ostream &out) {
267267
out << Val;
268268
}

0 commit comments

Comments
 (0)