From e4bdb935705036dc49018c39e4e0e01d849f01e4 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 21 Oct 2009 00:21:09 +0000 Subject: [PATCH] Publicize getSigilLoc / setSigilLoc for better metaprogramming. Fix the ReferenceTypeLoc hierarchy. llvm-svn: 84714 --- clang/include/clang/AST/TypeLoc.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 05eed0a18707..b980f2bd0ff8 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -467,7 +467,7 @@ struct PointerLikeLocInfo { template class PointerLikeTypeLoc : public ConcreteTypeLoc { -protected: +public: SourceLocation getSigilLoc() const { return this->getLocalData()->StarLoc; } @@ -475,7 +475,6 @@ protected: this->getLocalData()->StarLoc = Loc; } -public: TypeLoc getPointeeLoc() const { return this->getInnerTypeLoc(); } @@ -537,8 +536,10 @@ class ReferenceTypeLoc : public PointerLikeTypeLoc { }; -class LValueReferenceTypeLoc : public PointerLikeTypeLoc { +class LValueReferenceTypeLoc : + public InheritingConcreteTypeLoc { public: SourceLocation getAmpLoc() const { return getSigilLoc(); @@ -548,8 +549,10 @@ public: } }; -class RValueReferenceTypeLoc : public PointerLikeTypeLoc { +class RValueReferenceTypeLoc : + public InheritingConcreteTypeLoc { public: SourceLocation getAmpAmpLoc() const { return getSigilLoc(); -- GitLab