rsmith added inline comments.

================
Comment at: lib/CodeGen/CGExprScalar.cpp:3387-3392
@@ -3386,4 +3386,8 @@
 
-  llvm::Value *ArgValue = CGF.EmitVAListRef(VE->getSubExpr());
-  llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, VE->getType());
+  llvm::Value *ArgValue = VE->isMicrosoftABI() ?
+    CGF.EmitMSVAListRef(VE->getSubExpr()) :
+    CGF.EmitVAListRef(VE->getSubExpr());
+  llvm::Value *ArgPtr = VE->isMicrosoftABI() ?
+    CGF.EmitMSVAArg(ArgValue, VE->getType()) :
+    CGF.EmitVAArg(ArgValue, VE->getType());
   llvm::Type *ArgTy = ConvertType(VE->getType());
----------------
rsmith wrote:
> Do you really need this dispatch? `CodeGenFunction` dispatches this to the 
> function's ABI info class, which should do the right thing already.
Hmm, scratch that, it's entirely possible for an MS VA list to get passed into 
a non-MS-ABI function and then to have __builtin_va_arg called on it.


http://reviews.llvm.org/D1623



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to