forked from OSchip/llvm-project
Publish one more parser RAII for external use.
llvm-svn: 298842
This commit is contained in:
parent
8444d106d5
commit
d2a97e0b7e
|
@ -18,6 +18,7 @@
|
|||
#include "clang/Parse/ParseDiagnostic.h"
|
||||
#include "clang/Parse/Parser.h"
|
||||
#include "clang/Sema/DelayedDiagnostic.h"
|
||||
#include "clang/Sema/ParsedTemplate.h"
|
||||
#include "clang/Sema/Sema.h"
|
||||
|
||||
namespace clang {
|
||||
|
@ -442,6 +443,25 @@ namespace clang {
|
|||
void skipToEnd();
|
||||
};
|
||||
|
||||
/// \brief RAIIObject to destroy the contents of a SmallVector of
|
||||
/// TemplateIdAnnotation pointers and clear the vector.
|
||||
class DestroyTemplateIdAnnotationsRAIIObj {
|
||||
SmallVectorImpl<TemplateIdAnnotation *> &Container;
|
||||
|
||||
public:
|
||||
DestroyTemplateIdAnnotationsRAIIObj(
|
||||
SmallVectorImpl<TemplateIdAnnotation *> &Container)
|
||||
: Container(Container) {}
|
||||
|
||||
~DestroyTemplateIdAnnotationsRAIIObj() {
|
||||
for (SmallVectorImpl<TemplateIdAnnotation *>::iterator I =
|
||||
Container.begin(),
|
||||
E = Container.end();
|
||||
I != E; ++I)
|
||||
(*I)->Destroy();
|
||||
Container.clear();
|
||||
}
|
||||
};
|
||||
} // end namespace clang
|
||||
|
||||
#endif
|
||||
|
|
|
@ -37,26 +37,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief RAIIObject to destroy the contents of a SmallVector of
|
||||
/// TemplateIdAnnotation pointers and clear the vector.
|
||||
class DestroyTemplateIdAnnotationsRAIIObj {
|
||||
SmallVectorImpl<TemplateIdAnnotation *> &Container;
|
||||
|
||||
public:
|
||||
DestroyTemplateIdAnnotationsRAIIObj(
|
||||
SmallVectorImpl<TemplateIdAnnotation *> &Container)
|
||||
: Container(Container) {}
|
||||
|
||||
~DestroyTemplateIdAnnotationsRAIIObj() {
|
||||
for (SmallVectorImpl<TemplateIdAnnotation *>::iterator I =
|
||||
Container.begin(),
|
||||
E = Container.end();
|
||||
I != E; ++I)
|
||||
(*I)->Destroy();
|
||||
Container.clear();
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
IdentifierInfo *Parser::getSEHExceptKeyword() {
|
||||
|
|
Loading…
Reference in New Issue