summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-05-16 18:50:46 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-05-16 18:50:46 +0000
commite769ecf8ab786694aac6595902bd0cb691bbbe27 (patch)
tree705b368f8618b496b51ff4a1311af77b17818b40 /clang/lib/AST/Expr.cpp
parent4f8b8ed2ac98f477bcb8a04f3454bbe9006b330b (diff)
downloadbcm5719-llvm-e769ecf8ab786694aac6595902bd0cb691bbbe27.tar.gz
bcm5719-llvm-e769ecf8ab786694aac6595902bd0cb691bbbe27.zip
Implement instantiation of a few boring, simple expressions. I don't think these are testable yet, though.
llvm-svn: 71953
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 9a860033dfd..3133a8f42c2 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -27,10 +27,27 @@ using namespace clang;
// Primary Expressions.
//===----------------------------------------------------------------------===//
+PredefinedExpr* PredefinedExpr::Clone(ASTContext &C) const {
+ return new (C) PredefinedExpr(Loc, getType(), Type);
+}
+
IntegerLiteral* IntegerLiteral::Clone(ASTContext &C) const {
return new (C) IntegerLiteral(Value, getType(), Loc);
}
+CharacterLiteral* CharacterLiteral::Clone(ASTContext &C) const {
+ return new (C) CharacterLiteral(Value, IsWide, getType(), Loc);
+}
+
+FloatingLiteral* FloatingLiteral::Clone(ASTContext &C) const {
+ bool exact = IsExact;
+ return new (C) FloatingLiteral(Value, &exact, getType(), Loc);
+}
+
+GNUNullExpr* GNUNullExpr::Clone(ASTContext &C) const {
+ return new (C) GNUNullExpr(getType(), TokenLoc);
+}
+
/// getValueAsApproximateDouble - This returns the value as an inaccurate
/// double. Note that this may cause loss of precision, but is useful for
/// debugging dumps, etc.
OpenPOWER on IntegriCloud