From bb833dcc562f686a0652865d1945cfa3a421379c 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84714 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/TypeLoc.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 05eed0a187..b980f2bd0f 100644 --- a/include/clang/AST/TypeLoc.h +++ b/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(); -- 2.50.1