Skip to content

Commit 61412a7

Browse files
authored
Merge pull request #16372 from bob-wilson/fix-typerefs
[Reflection] Remove DEPENDENT_TEMPLATE2 macro
2 parents 0c0219c + 62b9375 commit 61412a7

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

include/swift/Reflection/TypeRef.h

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,20 @@ enum class TypeRefKind {
4040

4141
// MSVC reports an error if we use "template"
4242
// Clang reports an error if we don't use "template"
43-
#if defined(__APPLE_CC__)
43+
#if defined(__clang__) || defined(__GNUC__)
4444
# define DEPENDENT_TEMPLATE template
45-
# if __APPLE_CC__ >= 7000
46-
# define DEPENDENT_TEMPLATE2
47-
# else
48-
# define DEPENDENT_TEMPLATE2 template
49-
# endif
50-
#elif defined(__clang__) || defined(__GNUC__)
51-
# define DEPENDENT_TEMPLATE template
52-
# if __clang_major__ >= 7
53-
# define DEPENDENT_TEMPLATE2
54-
# else
55-
# define DEPENDENT_TEMPLATE2 template
56-
# endif
5745
#else
58-
# define DEPENDENT_TEMPLATE template
59-
# define DEPENDENT_TEMPLATE2
46+
# define DEPENDENT_TEMPLATE
6047
#endif
6148

6249
#define FIND_OR_CREATE_TYPEREF(Allocator, TypeRefTy, ...) \
6350
auto ID = Profile(__VA_ARGS__); \
64-
const auto Entry = Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.find(ID); \
65-
if (Entry != Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.end()) \
51+
const auto Entry = Allocator.TypeRefTy##s.find(ID); \
52+
if (Entry != Allocator.TypeRefTy##s.end()) \
6653
return Entry->second; \
6754
const auto TR = \
6855
Allocator.DEPENDENT_TEMPLATE makeTypeRef<TypeRefTy>(__VA_ARGS__); \
69-
Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.insert({ID, TR}); \
56+
Allocator.TypeRefTy##s.insert({ID, TR}); \
7057
return TR;
7158

7259
/// An identifier containing the unique bit pattern made up of all of the

0 commit comments

Comments
 (0)