diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-05-18 22:38:38 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-05-18 22:38:38 +0000 |
| commit | 38e7f8bd6d30a819caa4b957e2c364c7342a5563 (patch) | |
| tree | e2d623621e0c09e438d5881095410313e2c034f3 /clang/lib/AST/Expr.cpp | |
| parent | 1992f86733e36cc2b48464b6338a80b6b567b6fd (diff) | |
| download | bcm5719-llvm-38e7f8bd6d30a819caa4b957e2c364c7342a5563.tar.gz bcm5719-llvm-38e7f8bd6d30a819caa4b957e2c364c7342a5563.zip | |
Template instantiation for imaginary literals, because they were next in Expr.h
llvm-svn: 72058
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 19ab835707b..6bafdf278d8 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -44,6 +44,16 @@ FloatingLiteral* FloatingLiteral::Clone(ASTContext &C) const { return new (C) FloatingLiteral(Value, &exact, getType(), Loc); } +ImaginaryLiteral* ImaginaryLiteral::Clone(ASTContext &C) const { + // FIXME: Use virtual Clone(), once it is available + Expr *ClonedVal = 0; + if (const IntegerLiteral *IntLit = dyn_cast<IntegerLiteral>(Val)) + ClonedVal = IntLit->Clone(C); + else + ClonedVal = cast<FloatingLiteral>(Val)->Clone(C); + return new (C) ImaginaryLiteral(ClonedVal, getType()); +} + GNUNullExpr* GNUNullExpr::Clone(ASTContext &C) const { return new (C) GNUNullExpr(getType(), TokenLoc); } |

