r281404 - ObjectiveC Generics: follow-up commit to r281355.

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 14:57:29 PDT 2016


Author: mren
Date: Tue Sep 13 16:57:28 2016
New Revision: 281404

URL: http://llvm.org/viewvc/llvm-project?rev=281404&view=rev
Log:
ObjectiveC Generics: follow-up commit to r281355.

Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc.

rdar://24619481
rdar://25060179

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=281404&r1=281403&r2=281404&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Tue Sep 13 16:57:28 2016
@@ -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<SourceLocation>();




More information about the cfe-commits mailing list