[PATCH] D1623: Support __builtin_ms_va_list.

Charles Davis via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 13:43:12 PDT 2015


cdavis5x updated this revision to Diff 34728.
cdavis5x added a comment.

Address review comments.

- Pull out `va_arg` emission on `__builtin_ms_va_arg` to its own method on `ABIInfo`. That way, ABI implementers don't need to care that this extension even exists.
- Attempt to push repeated `va_arg` emission code in CGExpr{Scalar,Agg,Complex}.cpp down into `CodeGenFunction::EmitVAArg`.
- Don't ever consider a `VAArgExpr` to be a Microsoft one when the native `va_list` happens to be the same as the MS one.

Also:

- Rebase onto http://reviews.llvm.org/rL247603.
- Add a test that we lower `va_arg()` and `va_copy()` correctly even with a Win64 `va_list` inside a System V function.


http://reviews.llvm.org/D1623

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/Expr.h
  include/clang/Basic/BuiltinsX86.def
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/TargetInfo.h
  include/clang/Sema/Sema.h
  include/clang/Serialization/ASTBitCodes.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTDiagnostic.cpp
  lib/Basic/TargetInfo.cpp
  lib/Basic/Targets.cpp
  lib/CodeGen/ABIInfo.h
  lib/CodeGen/CGBuiltin.cpp
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CGExprAgg.cpp
  lib/CodeGen/CGExprComplex.cpp
  lib/CodeGen/CGExprScalar.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/CodeGen/TargetInfo.cpp
  lib/Sema/Sema.cpp
  lib/Sema/SemaChecking.cpp
  lib/Sema/SemaExpr.cpp
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriter.cpp
  lib/Serialization/ASTWriterStmt.cpp
  test/CodeGen/ms_abi.c
  test/PCH/Inputs/va_arg.h
  test/PCH/va_arg.c
  test/PCH/va_arg.cpp
  test/PCH/va_arg.h
  test/Sema/varargs-win64.c
  test/Sema/varargs-x86-32.c
  test/Sema/varargs-x86-64.c
  test/SemaTemplate/instantiate-expr-3.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1623.34728.patch
Type: text/x-patch
Size: 48868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150914/eade505a/attachment-0001.bin>


More information about the cfe-commits mailing list