Use EmitVAListRef instead of EmitLValue directly to handle array decay

case on x86_64.

llvm-svn: 64333
This commit is contained in:
Daniel Dunbar 2009-02-11 22:25:55 +00:00
parent cd4a301a1a
commit e9fcadd2a6
4 changed files with 3 additions and 4 deletions

View File

@ -53,7 +53,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
case Builtin::BI__builtin_stdarg_start:
case Builtin::BI__builtin_va_start:
case Builtin::BI__builtin_va_end: {
Value *ArgValue = EmitVAListRef(E->getArg(0));;
Value *ArgValue = EmitVAListRef(E->getArg(0));
const llvm::Type *DestType =
llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
if (ArgValue->getType() != DestType)

View File

@ -289,7 +289,7 @@ void AggExprEmitter::VisitConditionalOperator(const ConditionalOperator *E) {
}
void AggExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
llvm::Value *ArgValue = CGF.EmitLValue(VE->getSubExpr()).getAddress();
llvm::Value *ArgValue = CGF.EmitVAListRef(VE->getSubExpr());
llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, VE->getType());
if (!ArgPtr) {

View File

@ -531,7 +531,7 @@ ComplexPairTy ComplexExprEmitter::VisitInitListExpr(InitListExpr *E) {
}
ComplexPairTy ComplexExprEmitter::VisitVAArgExpr(VAArgExpr *E) {
llvm::Value *ArgValue = CGF.EmitLValue(E->getSubExpr()).getAddress();
llvm::Value *ArgValue = CGF.EmitVAListRef(E->getSubExpr());
llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, E->getType());
if (!ArgPtr) {

View File

@ -1336,7 +1336,6 @@ Value *ScalarExprEmitter::VisitOverloadExpr(OverloadExpr *E) {
Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
llvm::Value *ArgValue = CGF.EmitVAListRef(VE->getSubExpr());
llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, VE->getType());
// If EmitVAArg fails, we fall back to the LLVM instruction.