From d33b4a6292a4227bba53a73e33ba553e1cc67fb9 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 13 Sep 2016 21:57:28 +0000 Subject: [PATCH] ObjectiveC Generics: follow-up commit to r281355. Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc. rdar://24619481 rdar://25060179 llvm-svn: 281404 --- clang/include/clang/AST/TypeLoc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 5d7770d..d3db024 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/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(); -- 2.7.4