diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-08 13:09:47 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-08 13:09:47 +0000 |
commit | 663e380d7b2de2bbf20e886e05371195bea9adc4 (patch) | |
tree | 86adb15f596a10cd9abb394a5f7af6eb2898e2e5 /lib/AST/Expr.cpp | |
parent | 82f8e796d6ffce1d63729a2df87c1060edf6593a (diff) |
Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index e84f73a1aa..cc6ad5ab46 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -228,6 +228,19 @@ DeclRefExpr *DeclRefExpr::Create(ASTContext &Context, TemplateArgs, T); } +DeclRefExpr *DeclRefExpr::CreateEmpty(ASTContext &Context, bool HasQualifier, + unsigned NumTemplateArgs) { + std::size_t Size = sizeof(DeclRefExpr); + if (HasQualifier) + Size += sizeof(NameQualifier); + + if (NumTemplateArgs) + Size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs); + + void *Mem = Context.Allocate(Size, llvm::alignof<DeclRefExpr>()); + return new (Mem) DeclRefExpr(EmptyShell()); +} + SourceRange DeclRefExpr::getSourceRange() const { // FIXME: Does not handle multi-token names well, e.g., operator[]. SourceRange R(Loc); |