[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 14:45:11 PST 2018


vsapsai updated this revision to Diff 130038.
vsapsai added a comment.

- Try another approach for the fix. It has broader impact but semantically seems to be more correct.

Also I think `hasScalarEvaluationKind` should use `Arg->getType()` everywhere
as it matches `EmitParmDecl` behaviour. Instead of updating all
`hasScalarEvaluationKind` calls I've added an assertion to verify it doesn't
matter if we call it with `Arg->getType()` or `Ty`.


https://reviews.llvm.org/D41311

Files:
  clang/lib/CodeGen/CGCall.cpp
  clang/test/CodeGen/kr-func-promote.c
  clang/test/CodeGen/transparent-union-redecl.c
  clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
  clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
  clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
  clang/test/Sema/transparent-union.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41311.130038.patch
Type: text/x-patch
Size: 9985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180116/f160f95f/attachment.bin>


More information about the cfe-commits mailing list