From 2f5dc240d1b2bb0f71843f64d60c7878c0b3ac9d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 9 Aug 2017 18:34:22 +0000 Subject: [PATCH] PointerLikeTypeTraits: class->struct to match LLVM change git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310508 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/CanonicalType.h | 3 +-- include/clang/AST/DeclCXX.h | 3 +-- include/clang/AST/DeclGroup.h | 5 ++--- include/clang/AST/TemplateName.h | 3 +-- include/clang/AST/Type.h | 11 ++++------- include/clang/Basic/IdentifierTable.h | 11 ++++------- include/clang/Basic/SourceLocation.h | 3 +-- include/clang/CodeGen/ConstantInitFuture.h | 6 ++---- include/clang/Sema/Ownership.h | 3 +-- 9 files changed, 17 insertions(+), 31 deletions(-) diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h index 25f6172be9..023456e2e3 100644 --- a/include/clang/AST/CanonicalType.h +++ b/include/clang/AST/CanonicalType.h @@ -359,8 +359,7 @@ struct simplify_type< ::clang::CanQual > { // Teach SmallPtrSet that CanQual is "basically a pointer". template -class PointerLikeTypeTraits > { -public: +struct PointerLikeTypeTraits > { static inline void *getAsVoidPointer(clang::CanQual P) { return P.getAsOpaquePtr(); } diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 9d64f0244e..976c798966 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -73,8 +73,7 @@ public: namespace llvm { // Provide PointerLikeTypeTraits for non-cvr pointers. template<> - class PointerLikeTypeTraits< ::clang::AnyFunctionDecl> { - public: + struct PointerLikeTypeTraits< ::clang::AnyFunctionDecl> { static inline void *getAsVoidPointer(::clang::AnyFunctionDecl F) { return F.get(); } diff --git a/include/clang/AST/DeclGroup.h b/include/clang/AST/DeclGroup.h index 6353b26f7b..628d7886aa 100644 --- a/include/clang/AST/DeclGroup.h +++ b/include/clang/AST/DeclGroup.h @@ -138,10 +138,9 @@ public: namespace llvm { // DeclGroupRef is "like a pointer", implement PointerLikeTypeTraits. template - class PointerLikeTypeTraits; + struct PointerLikeTypeTraits; template <> - class PointerLikeTypeTraits { - public: + struct PointerLikeTypeTraits { static inline void *getAsVoidPointer(clang::DeclGroupRef P) { return P.getAsOpaquePtr(); } diff --git a/include/clang/AST/TemplateName.h b/include/clang/AST/TemplateName.h index bf4d008ee8..30ee834fd3 100644 --- a/include/clang/AST/TemplateName.h +++ b/include/clang/AST/TemplateName.h @@ -515,8 +515,7 @@ namespace llvm { /// \brief The clang::TemplateName class is effectively a pointer. template<> -class PointerLikeTypeTraits { -public: +struct PointerLikeTypeTraits { static inline void *getAsVoidPointer(clang::TemplateName TN) { return TN.getAsVoidPointer(); } diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 984096ffa9..2fe070c9af 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -48,10 +48,9 @@ namespace clang { namespace llvm { template - class PointerLikeTypeTraits; + struct PointerLikeTypeTraits; template<> - class PointerLikeTypeTraits< ::clang::Type*> { - public: + struct PointerLikeTypeTraits< ::clang::Type*> { static inline void *getAsVoidPointer(::clang::Type *P) { return P; } static inline ::clang::Type *getFromVoidPointer(void *P) { return static_cast< ::clang::Type*>(P); @@ -59,8 +58,7 @@ namespace llvm { enum { NumLowBitsAvailable = clang::TypeAlignmentInBits }; }; template<> - class PointerLikeTypeTraits< ::clang::ExtQuals*> { - public: + struct PointerLikeTypeTraits< ::clang::ExtQuals*> { static inline void *getAsVoidPointer(::clang::ExtQuals *P) { return P; } static inline ::clang::ExtQuals *getFromVoidPointer(void *P) { return static_cast< ::clang::ExtQuals*>(P); @@ -1143,8 +1141,7 @@ template<> struct simplify_type< ::clang::QualType> { // Teach SmallPtrSet that QualType is "basically a pointer". template<> -class PointerLikeTypeTraits { -public: +struct PointerLikeTypeTraits { static inline void *getAsVoidPointer(clang::QualType P) { return P.getAsOpaquePtr(); } diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index f94b2c9b2f..3938e09890 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -874,11 +874,10 @@ struct DenseMapInfo { template <> struct isPodLike { static const bool value = true; }; -template class PointerLikeTypeTraits; +template struct PointerLikeTypeTraits; template<> -class PointerLikeTypeTraits { -public: +struct PointerLikeTypeTraits { static inline const void *getAsVoidPointer(clang::Selector P) { return P.getAsOpaquePtr(); } @@ -893,8 +892,7 @@ public: // Provide PointerLikeTypeTraits for IdentifierInfo pointers, which // are not guaranteed to be 8-byte aligned. template<> -class PointerLikeTypeTraits { -public: +struct PointerLikeTypeTraits { static inline void *getAsVoidPointer(clang::IdentifierInfo* P) { return P; } @@ -907,8 +905,7 @@ public: }; template<> -class PointerLikeTypeTraits { -public: +struct PointerLikeTypeTraits { static inline const void *getAsVoidPointer(const clang::IdentifierInfo* P) { return P; } diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 12aa0e4f57..6afec33445 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -455,8 +455,7 @@ namespace llvm { // Teach SmallPtrSet how to handle SourceLocation. template<> - class PointerLikeTypeTraits { - public: + struct PointerLikeTypeTraits { static inline void *getAsVoidPointer(clang::SourceLocation L) { return L.getPtrEncoding(); } diff --git a/include/clang/CodeGen/ConstantInitFuture.h b/include/clang/CodeGen/ConstantInitFuture.h index ef1a5d2f49..f1a7e2264f 100644 --- a/include/clang/CodeGen/ConstantInitFuture.h +++ b/include/clang/CodeGen/ConstantInitFuture.h @@ -31,8 +31,7 @@ class ConstantInitBuilderBase; } namespace llvm { template <> -class PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitBuilderBase*> { -public: +struct PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitBuilderBase*> { using T = ::clang::CodeGen::ConstantInitBuilderBase*; static inline void *getAsVoidPointer(T p) { return p; } @@ -93,8 +92,7 @@ public: namespace llvm { template <> -class PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitFuture> { -public: +struct PointerLikeTypeTraits< ::clang::CodeGen::ConstantInitFuture> { using T = ::clang::CodeGen::ConstantInitFuture; static inline void *getAsVoidPointer(T future) { diff --git a/include/clang/Sema/Ownership.h b/include/clang/Sema/Ownership.h index 848837a1de..1e35316fd5 100644 --- a/include/clang/Sema/Ownership.h +++ b/include/clang/Sema/Ownership.h @@ -107,8 +107,7 @@ namespace clang { namespace llvm { template - class PointerLikeTypeTraits > { - public: + struct PointerLikeTypeTraits > { static inline void *getAsVoidPointer(clang::OpaquePtr P) { // FIXME: Doesn't work? return P.getAs< void >(); return P.getAsOpaquePtr(); -- 2.50.0