summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 842caa8d00a..0f3cbe18d9e 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -111,10 +111,9 @@ StringLiteral* StringLiteral::Clone(ASTContext &C) const {
TokLocs, NumConcatenated);
}
-void StringLiteral::Destroy(ASTContext &C) {
+void StringLiteral::DoDestroy(ASTContext &C) {
C.Deallocate(const_cast<char*>(StrData));
- this->~StringLiteral();
- C.Deallocate(this);
+ Expr::DoDestroy(C);
}
void StringLiteral::setStrData(ASTContext &C, const char *Str, unsigned Len) {
@@ -218,7 +217,7 @@ CallExpr::CallExpr(ASTContext &C, StmtClass SC, EmptyShell Empty)
SubExprs = new (C) Stmt*[1];
}
-void CallExpr::Destroy(ASTContext& C) {
+void CallExpr::DoDestroy(ASTContext& C) {
DestroyChildren(C);
if (SubExprs) C.Deallocate(SubExprs);
this->~CallExpr();
@@ -1657,7 +1656,7 @@ void ShuffleVectorExpr::setExprs(Expr ** Exprs, unsigned NumExprs) {
memcpy(SubExprs, Exprs, sizeof(Expr *) * NumExprs);
}
-void SizeOfAlignOfExpr::Destroy(ASTContext& C) {
+void SizeOfAlignOfExpr::DoDestroy(ASTContext& C) {
// Override default behavior of traversing children. If this has a type
// operand and the type is a variable-length array, the child iteration
// will iterate over the size expression. However, this expression belongs
@@ -1668,7 +1667,7 @@ void SizeOfAlignOfExpr::Destroy(ASTContext& C) {
C.Deallocate(this);
}
else
- Expr::Destroy(C);
+ Expr::DoDestroy(C);
}
//===----------------------------------------------------------------------===//
@@ -1831,9 +1830,9 @@ void DesignatedInitExpr::ExpandDesignator(unsigned Idx,
NumDesignators = NumDesignators - 1 + NumNewDesignators;
}
-void DesignatedInitExpr::Destroy(ASTContext &C) {
+void DesignatedInitExpr::DoDestroy(ASTContext &C) {
delete [] Designators;
- Expr::Destroy(C);
+ Expr::DoDestroy(C);
}
ImplicitValueInitExpr *ImplicitValueInitExpr::Clone(ASTContext &C) const {
OpenPOWER on IntegriCloud