Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't support anything but at least we don't crash ;)

llvm-svn: 72147
This commit is contained in:
Anders Carlsson 2009-05-20 00:24:07 +00:00
parent 95fc37fd8f
commit 6f5a015bd9
4 changed files with 14 additions and 1 deletions

View File

@ -260,4 +260,3 @@ const char *CodeGenModule::getMangledCXXDtorName(const CXXDestructorDecl *D,
Name += '\0';
return UniqueMangledName(Name.begin(), Name.end());
}

View File

@ -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);
}

View File

@ -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,

View File

@ -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
//===--------------------------------------------------------------------===//