[cfe-commits] r72147 - in /cfe/trunk/lib/CodeGen: CGCXX.cpp CGCall.cpp CGExpr.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Tue May 19 17:24:08 PDT 2009
Author: andersca
Date: Tue May 19 19:24:07 2009
New Revision: 72147
URL: http://llvm.org/viewvc/llvm-project?rev=72147&view=rev
Log:
Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't support anything but at least we don't crash ;)
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=72147&r1=72146&r2=72147&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Tue May 19 19:24:07 2009
@@ -260,4 +260,3 @@
Name += '\0';
return UniqueMangledName(Name.begin(), Name.end());
}
-
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=72147&r1=72146&r2=72147&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Tue May 19 19:24:07 2009
@@ -2001,6 +2001,9 @@
}
RValue CodeGenFunction::EmitCallArg(const Expr *E, QualType ArgType) {
+ if (ArgType->isReferenceType())
+ return EmitReferenceBindingToExpr(E, ArgType);
+
return EmitAnyExprToTemp(E);
}
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=72147&r1=72146&r2=72147&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue May 19 19:24:07 2009
@@ -70,6 +70,13 @@
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,
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=72147&r1=72146&r2=72147&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue May 19 19:24:07 2009
@@ -708,6 +708,10 @@
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
//===--------------------------------------------------------------------===//
More information about the cfe-commits
mailing list