]> granicus.if.org Git - clang/commitdiff
Provide a method to clear the current state of a TypeLocBuilder.
authorJohn McCall <rjmccall@apple.com>
Fri, 11 Jun 2010 00:26:38 +0000 (00:26 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 11 Jun 2010 00:26:38 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105800 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TypeLocBuilder.h

index e729488e4313595f8a09db027435ae09b558e69c..880af267f324636794a7e7e4a69d30708073f4c8 100644 (file)
@@ -79,7 +79,14 @@ class TypeLocBuilder {
     size_t LocalSize = TypeSpecTypeLoc::LocalDataSize;
     return cast<TypeSpecTypeLoc>(pushImpl(T, LocalSize));
   }
-  
+
+  /// Resets this builder to the newly-initialized state.
+  void clear() {
+#ifndef NDEBUG
+    LastTy = QualType();
+#endif
+    Index = Capacity;
+  }  
 
   /// Pushes space for a new TypeLoc of the given type.  Invalidates
   /// any TypeLocs previously retrieved from this builder.