diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-08 02:50:17 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-08 02:50:17 +0000 |
commit | d497206844a894a0557e927adf29b34fe960dffd (patch) | |
tree | 4b52f7eba08250d43628266b0b65e10ea2b5f087 /lib/AST/Expr.cpp | |
parent | 43d9d9243329b1b75d1a6efdad9f16d6fb386b8e (diff) |
Get rid of Stmt::Clone now that we can reference count statements instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 0f3cbe18d9..2c07de6c79 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -28,36 +28,6 @@ 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 { - return new (C) FloatingLiteral(Value, IsExact, 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); -} - /// getValueAsApproximateDouble - This returns the value as an inaccurate /// double. Note that this may cause loss of precision, but is useful for /// debugging dumps, etc. @@ -106,11 +76,6 @@ StringLiteral *StringLiteral::CreateEmpty(ASTContext &C, unsigned NumStrs) { return SL; } -StringLiteral* StringLiteral::Clone(ASTContext &C) const { - return Create(C, StrData, ByteLength, IsWide, getType(), - TokLocs, NumConcatenated); -} - void StringLiteral::DoDestroy(ASTContext &C) { C.Deallocate(const_cast<char*>(StrData)); Expr::DoDestroy(C); @@ -1564,22 +1529,6 @@ ObjCMessageExpr::ObjCMessageExpr(Expr *receiver, Selector selInfo, RBracloc = RBrac; } -ObjCStringLiteral* ObjCStringLiteral::Clone(ASTContext &C) const { - // Clone the string literal. - StringLiteral *NewString = - String ? cast<StringLiteral>(String)->Clone(C) : 0; - - return new (C) ObjCStringLiteral(NewString, getType(), AtLoc); -} - -ObjCSelectorExpr *ObjCSelectorExpr::Clone(ASTContext &C) const { - return new (C) ObjCSelectorExpr(getType(), SelName, AtLoc, RParenLoc); -} - -ObjCProtocolExpr *ObjCProtocolExpr::Clone(ASTContext &C) const { - return new (C) ObjCProtocolExpr(getType(), TheProtocol, AtLoc, RParenLoc); -} - // constructor for class messages. // FIXME: clsName should be typed to ObjCInterfaceType ObjCMessageExpr::ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo, @@ -1835,10 +1784,6 @@ void DesignatedInitExpr::DoDestroy(ASTContext &C) { Expr::DoDestroy(C); } -ImplicitValueInitExpr *ImplicitValueInitExpr::Clone(ASTContext &C) const { - return new (C) ImplicitValueInitExpr(getType()); -} - //===----------------------------------------------------------------------===// // ExprIterator. //===----------------------------------------------------------------------===// |