Skip to content

Commit d85248b

Browse files
committed
Provide a method to clear the current state of a TypeLocBuilder.
llvm-svn: 105800
1 parent 5b405ed commit d85248b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/include/clang/AST/TypeLocBuilder.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ class TypeLocBuilder {
7979
size_t LocalSize = TypeSpecTypeLoc::LocalDataSize;
8080
return cast<TypeSpecTypeLoc>(pushImpl(T, LocalSize));
8181
}
82-
82+
83+
/// Resets this builder to the newly-initialized state.
84+
void clear() {
85+
#ifndef NDEBUG
86+
LastTy = QualType();
87+
#endif
88+
Index = Capacity;
89+
}
8390

8491
/// Pushes space for a new TypeLoc of the given type. Invalidates
8592
/// any TypeLocs previously retrieved from this builder.

0 commit comments

Comments
 (0)