Fix for PR3350: add special-casing for "references" to va_lists in
builtins.
Also, a minor tweak to va_copy for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62574 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 6e140da..2d840ff 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -67,11 +67,7 @@
case Builtin::BI__builtin_va_copy: {
// FIXME: This does not yet handle architectures where va_list is a struct.
Value *DstPtr = EmitLValue(E->getArg(0)).getAddress();
- Value *SrcValue = EmitScalarExpr(E->getArg(1));
-
- Value *SrcPtr = CreateTempAlloca(SrcValue->getType(), "dst_ptr");
-
- Builder.CreateStore(SrcValue, SrcPtr, false);
+ Value *SrcPtr = EmitLValue(E->getArg(1)).getAddress();
const llvm::Type *Type =
llvm::PointerType::getUnqual(llvm::Type::Int8Ty);