diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-05-20 00:24:07 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-05-20 00:24:07 +0000 |
| commit | 6f5a015bd9528383ea5ca591a6c6c070c800d7d6 (patch) | |
| tree | 0e57e944932eaff73068ccff89f81112c7ef5e9a /clang/lib/CodeGen | |
| parent | 95fc37fd8fe5537dbea9dfef55e61696a55a36d7 (diff) | |
| download | bcm5719-llvm-6f5a015bd9528383ea5ca591a6c6c070c800d7d6.tar.gz bcm5719-llvm-6f5a015bd9528383ea5ca591a6c6c070c800d7d6.zip | |
Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't support anything but at least we don't crash ;)
llvm-svn: 72147
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 7 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
4 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index e0ea2b98eb0..02574949774 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -260,4 +260,3 @@ const char *CodeGenModule::getMangledCXXDtorName(const CXXDestructorDecl *D, Name += '\0'; return UniqueMangledName(Name.begin(), Name.end()); } - diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 10fc6d95c25..d444baec8e3 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2001,6 +2001,9 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, } RValue CodeGenFunction::EmitCallArg(const Expr *E, QualType ArgType) { + if (ArgType->isReferenceType()) + return EmitReferenceBindingToExpr(E, ArgType); + return EmitAnyExprToTemp(E); } diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index ad0baa32f94..dc447983f0e 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -70,6 +70,13 @@ RValue CodeGenFunction::EmitAnyExprToTemp(const Expr *E, llvm::Value *AggLoc, return EmitAnyExpr(E, AggLoc, isAggLocVolatile); } +RValue CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E, + QualType DestType) { + CGM.ErrorUnsupported(E, "reference binding"); + return GetUndefRValue(DestType); +} + + /// getAccessedFieldNo - Given an encoded value and a result number, return /// the input field number being accessed. unsigned CodeGenFunction::getAccessedFieldNo(unsigned Idx, diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 081e44f915f..130bc369e3b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -708,6 +708,10 @@ public: void EmitObjCSuperPropertySet(const Expr *E, const Selector &S, RValue Src); + /// EmitReferenceBindingToExpr - Emits a reference binding to the passed in + /// expression. Will emit a temporary variable if E is not an LValue. + RValue EmitReferenceBindingToExpr(const Expr* E, QualType DestType); + //===--------------------------------------------------------------------===// // Expression Emission //===--------------------------------------------------------------------===// |

