]> granicus.if.org Git - clang/commitdiff
Be sure to initialize the "has base type as written" field of an
authorJohn McCall <rjmccall@apple.com>
Sun, 16 May 2010 02:12:01 +0000 (02:12 +0000)
committerJohn McCall <rjmccall@apple.com>
Sun, 16 May 2010 02:12:01 +0000 (02:12 +0000)
ObjCObjectTypeLoc.  This should clear up some valgrind errors we've
been seeing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103894 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TypeLoc.h

index 4896fe948bdbce21919deee780645884eefae12c..ae478c8c8dd5211c6ab94aaddfa5d80f2917bc1d 100644 (file)
@@ -559,7 +559,7 @@ class SubstTemplateTypeParmTypeLoc :
 struct ObjCProtocolListLocInfo {
   SourceLocation LAngleLoc;
   SourceLocation RAngleLoc;
-  bool HasBaseType;
+  bool HasBaseTypeAsWritten;
 };
 
 // A helper class for defining ObjC TypeLocs that can qualified with
@@ -610,11 +610,11 @@ public:
   }
   
   bool hasBaseTypeAsWritten() const {
-    return getLocalData()->HasBaseType;
+    return getLocalData()->HasBaseTypeAsWritten;
   }
 
   void setHasBaseTypeAsWritten(bool HasBaseType) {
-    getLocalData()->HasBaseType = HasBaseType;
+    getLocalData()->HasBaseTypeAsWritten = HasBaseType;
   }
 
   TypeLoc getBaseLoc() const {
@@ -626,6 +626,7 @@ public:
   }
 
   void initializeLocal(SourceLocation Loc) {
+    setHasBaseTypeAsWritten(true);
     setLAngleLoc(Loc);
     setRAngleLoc(Loc);
     for (unsigned i = 0, e = getNumProtocols(); i != e; ++i)