From: Manman Ren Date: Tue, 13 Sep 2016 21:57:28 +0000 (+0000) Subject: ObjectiveC Generics: follow-up commit to r281355. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3f3e775cef7f57bec8c73afa87a6f66e5d6b917;p=clang ObjectiveC Generics: follow-up commit to r281355. Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc. rdar://24619481 rdar://25060179 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281404 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 5d7770d805..d3db024bc6 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -763,7 +763,9 @@ public: unsigned getExtraLocalDataSize() const { if (!this->getNumProtocols()) return 0; - return this->getNumProtocols() * sizeof(SourceLocation) ; + // When there are protocol qualifers, we have LAngleLoc and RAngleLoc + // as well. + return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ; } unsigned getExtraLocalDataAlignment() const { return llvm::alignOf();