diff options
author | John McCall <rjmccall@apple.com> | 2009-10-21 00:21:09 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-21 00:21:09 +0000 |
commit | bb833dcc562f686a0652865d1945cfa3a421379c (patch) | |
tree | f72bf564f94c140a62dd6bd2753b2745d1d403a5 | |
parent | da9b30ea415af1de659524c28793e2597342f6e8 (diff) |
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
-rw-r--r-- | include/clang/AST/TypeLoc.h | 15 |
1 files 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 Derived, class TypeClass, class LocalData = PointerLikeLocInfo> class PointerLikeTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> { -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<ReferenceTypeLoc, ReferenceType> { }; -class LValueReferenceTypeLoc : public PointerLikeTypeLoc<LValueReferenceTypeLoc, - LValueReferenceType> { +class LValueReferenceTypeLoc : + public InheritingConcreteTypeLoc<ReferenceTypeLoc, + LValueReferenceTypeLoc, + LValueReferenceType> { public: SourceLocation getAmpLoc() const { return getSigilLoc(); @@ -548,8 +549,10 @@ public: } }; -class RValueReferenceTypeLoc : public PointerLikeTypeLoc<RValueReferenceTypeLoc, - RValueReferenceType> { +class RValueReferenceTypeLoc : + public InheritingConcreteTypeLoc<ReferenceTypeLoc, + RValueReferenceTypeLoc, + RValueReferenceType> { public: SourceLocation getAmpAmpLoc() const { return getSigilLoc(); |