forked from OSchip/llvm-project
Use EmitVAListRef instead of EmitLValue directly to handle array decay
case on x86_64. llvm-svn: 64333
This commit is contained in:
parent
cd4a301a1a
commit
e9fcadd2a6
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue