diff options
Diffstat (limited to 'lib/AST/TypeLoc.cpp')
-rw-r--r-- | lib/AST/TypeLoc.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index cea8dc5169..fbd7caa326 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -83,6 +83,7 @@ public: /// \brief Returns the size of the type source info data block. unsigned TypeLoc::getFullDataSize() const { + if (isNull()) return 0; return TypeSizer().Visit(*this); } @@ -98,6 +99,7 @@ public: #include "clang/AST/TypeLocNodes.def" TypeLoc VisitTypeSpecLoc(TypeLoc TyLoc) { return TypeLoc(); } + TypeLoc VisitObjCProtocolListLoc(ObjCProtocolListLoc TL); TypeLoc VisitTypeLoc(TypeLoc TyLoc) { assert(0 && "A declarator loc wrapper was not handled!"); @@ -107,6 +109,10 @@ public: } +TypeLoc NextLoc::VisitObjCProtocolListLoc(ObjCProtocolListLoc TL) { + return TL.getBaseTypeLoc(); +} + TypeLoc NextLoc::VisitPointerLoc(PointerLoc TL) { return TL.getPointeeLoc(); } @@ -224,6 +230,24 @@ bool TypedefLoc::classof(const TypeLoc *TL) { } //===----------------------------------------------------------------------===// +// ObjCProtocolListLoc Implementation +//===----------------------------------------------------------------------===// + +namespace { + +class ObjCProtocolListLocChecker : + public TypeLocVisitor<ObjCProtocolListLocChecker, bool> { +public: + bool VisitObjCProtocolListLoc(ObjCProtocolListLoc TyLoc) { return true; } +}; + +} + +bool ObjCProtocolListLoc::classof(const TypeLoc *TL) { + return ObjCProtocolListLocChecker().Visit(*TL); +} + +//===----------------------------------------------------------------------===// // PointerLoc Implementation //===----------------------------------------------------------------------===// |