[cfe-commits] r84714 - /cfe/trunk/include/clang/AST/TypeLoc.h

John McCall rjmccall at apple.com
Tue Oct 20 17:21:10 PDT 2009


Author: rjmccall
Date: Tue Oct 20 19:21:09 2009
New Revision: 84714

URL: http://llvm.org/viewvc/llvm-project?rev=84714&view=rev
Log:
Publicize getSigilLoc / setSigilLoc for better metaprogramming.

Fix the ReferenceTypeLoc hierarchy.


Modified:
    cfe/trunk/include/clang/AST/TypeLoc.h

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=84714&r1=84713&r2=84714&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Tue Oct 20 19:21:09 2009
@@ -467,7 +467,7 @@
 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 @@
     this->getLocalData()->StarLoc = Loc;
   }
 
-public:  
   TypeLoc getPointeeLoc() const {
     return this->getInnerTypeLoc();
   }
@@ -537,8 +536,10 @@
                                                    ReferenceType> {
 };
 
-class LValueReferenceTypeLoc : public PointerLikeTypeLoc<LValueReferenceTypeLoc,
-                                                         LValueReferenceType> {
+class LValueReferenceTypeLoc :
+    public InheritingConcreteTypeLoc<ReferenceTypeLoc,
+                                     LValueReferenceTypeLoc,
+                                     LValueReferenceType> {
 public:
   SourceLocation getAmpLoc() const {
     return getSigilLoc();
@@ -548,8 +549,10 @@
   }
 };
 
-class RValueReferenceTypeLoc : public PointerLikeTypeLoc<RValueReferenceTypeLoc,
-                                                         RValueReferenceType> {
+class RValueReferenceTypeLoc :
+    public InheritingConcreteTypeLoc<ReferenceTypeLoc,
+                                     RValueReferenceTypeLoc,
+                                     RValueReferenceType> {
 public:
   SourceLocation getAmpAmpLoc() const {
     return getSigilLoc();





More information about the cfe-commits mailing list