diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-04-16 00:55:48 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-04-16 00:55:48 +0000 |
| commit | 38676d50dc05b75f410e79a57e2d5ae357b93c68 (patch) | |
| tree | 80acb49ddccecef9b05a41f95c166d8834366061 /clang/lib/AST/Expr.cpp | |
| parent | e82c3cc84879b0704d49f7f28d16f8869de85196 (diff) | |
| download | bcm5719-llvm-38676d50dc05b75f410e79a57e2d5ae357b93c68.tar.gz bcm5719-llvm-38676d50dc05b75f410e79a57e2d5ae357b93c68.zip | |
PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.
llvm-svn: 69251
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index e1603c90e15..9e8958c0733 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -1581,6 +1581,24 @@ DesignatedInitExpr::Create(ASTContext &C, Designator *Designators, return DIE; } +DesignatedInitExpr *DesignatedInitExpr::CreateEmpty(ASTContext &C, + unsigned NumIndexExprs) { + void *Mem = C.Allocate(sizeof(DesignatedInitExpr) + + sizeof(Stmt *) * (NumIndexExprs + 1), 8); + return new (Mem) DesignatedInitExpr(NumIndexExprs + 1); +} + +void DesignatedInitExpr::setDesignators(const Designator *Desigs, + unsigned NumDesigs) { + if (Designators) + delete [] Designators; + + Designators = new Designator[NumDesigs]; + NumDesignators = NumDesigs; + for (unsigned I = 0; I != NumDesigs; ++I) + Designators[I] = Desigs[I]; +} + SourceRange DesignatedInitExpr::getSourceRange() const { SourceLocation StartLoc; Designator &First = |

