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 | e4bdb935705036dc49018c39e4e0e01d849f01e4 (patch) | |
| tree | a2808d309c7ba9dbd6bda8a51c8bdff642881b0f | |
| parent | 7099d0c19c569cd8dd794752adb0b4bb5ae2aa3c (diff) | |
| download | bcm5719-llvm-e4bdb935705036dc49018c39e4e0e01d849f01e4.tar.gz bcm5719-llvm-e4bdb935705036dc49018c39e4e0e01d849f01e4.zip | |
Publicize getSigilLoc / setSigilLoc for better metaprogramming.
Fix the ReferenceTypeLoc hierarchy.
llvm-svn: 84714
| -rw-r--r-- | clang/include/clang/AST/TypeLoc.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 05eed0a1870..b980f2bd0ff 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/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(); |

