зеркало из https://github.com/microsoft/clang.git
Add NullStmt::Clone and use it
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
137fa562ca
Коммит
d19cd90b26
|
@ -290,6 +290,8 @@ public:
|
|||
/// \brief Build an empty null statement.
|
||||
explicit NullStmt(EmptyShell Empty) : Stmt(NullStmtClass, Empty) { }
|
||||
|
||||
NullStmt* Clone(ASTContext &C) const;
|
||||
|
||||
SourceLocation getSemiLoc() const { return SemiLoc; }
|
||||
void setSemiLoc(SourceLocation L) { SemiLoc = L; }
|
||||
|
||||
|
|
|
@ -98,6 +98,10 @@ bool Stmt::CollectingStats(bool enable) {
|
|||
return StatSwitch;
|
||||
}
|
||||
|
||||
NullStmt* NullStmt::Clone(ASTContext &C) const {
|
||||
return new (C) NullStmt(SemiLoc);
|
||||
}
|
||||
|
||||
void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
|
||||
if (this->Body)
|
||||
C.Deallocate(Body);
|
||||
|
|
|
@ -480,7 +480,7 @@ Sema::OwningStmtResult TemplateStmtInstantiator::VisitDeclStmt(DeclStmt *S) {
|
|||
}
|
||||
|
||||
Sema::OwningStmtResult TemplateStmtInstantiator::VisitNullStmt(NullStmt *S) {
|
||||
return SemaRef.Owned(new (SemaRef.Context) NullStmt(S->getSemiLoc()));
|
||||
return SemaRef.Owned(S->Clone(SemaRef.Context));
|
||||
}
|
||||
|
||||
Sema::OwningStmtResult TemplateStmtInstantiator::VisitLabelStmt(LabelStmt *S) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче