From a00703dccbdc6cc4a293db38477dea7db5538c7e Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 31 May 2009 01:40:14 +0000 Subject: [PATCH] Add a new function for emitting new functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72656 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCXX.cpp | 5 +++++ lib/CodeGen/CGExprScalar.cpp | 3 +++ lib/CodeGen/CodeGenFunction.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 3186ccde66..805805c663 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -226,6 +226,11 @@ CodeGenFunction::EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E, return RV; } +llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) { + ErrorUnsupported(E, "new expression"); + return llvm::UndefValue::get(ConvertType(E->getType())); +} + static bool canGenerateCXXstructor(const CXXRecordDecl *RD, ASTContext &Context) { // The class has base classes - we don't support that right now. diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index e4d3ff5a2e..950e9e5509 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -285,6 +285,9 @@ public: Value *VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) { return CGF.EmitCXXExprWithTemporaries(E).getScalarVal(); } + Value *VisitCXXNewExpr(const CXXNewExpr *E) { + return CGF.EmitCXXNewExpr(E); + } // Binary Operators. Value *EmitMul(const BinOpInfo &Ops) { diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 2a2d11ea2e..b7894a4068 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -484,6 +484,8 @@ public: void PushCXXTemporary(const CXXTemporary *Temporary, llvm::Value *Ptr); + llvm::Value *EmitCXXNewExpr(const CXXNewExpr *E); + //===--------------------------------------------------------------------===// // Declaration Emission //===--------------------------------------------------------------------===// -- 2.40.0