aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2018-01-22 22:29:24 +0000
committerVolodymyr Sapsai <vsapsai@apple.com>2018-01-22 22:29:24 +0000
commit17ebdb239fee0bf6c349c13445ad9ec476552b59 (patch)
tree2f98e111630896e5a940861c04922d99b668ccfa /llvm/lib/Support/CommandLine.cpp
parentc58f2166ab3987f37cb0d7815b561bff5a20a69a (diff)
downloadllvm-17ebdb239fee0bf6c349c13445ad9ec476552b59.zip
llvm-17ebdb239fee0bf6c349c13445ad9ec476552b59.tar.gz
llvm-17ebdb239fee0bf6c349c13445ad9ec476552b59.tar.bz2
Reland "[CodeGen] Fix crash when a function taking transparent union is redeclared."
When a function taking transparent union is declared as taking one of union members earlier in the translation unit, clang would hit an "Invalid cast" assertion during EmitFunctionProlog. This case corresponds to function f1 in test/CodeGen/transparent-union-redecl.c. We decided to cast i32 to union because after merging function declarations function parameter type becomes int, CGFunctionInfo::ArgInfo type matches with ABIArgInfo type, so we decide it is a trivial case. But these types should also be castable to parameter declaration type which is not the case here. Now the fix is in converting from ABIArgInfo type to VarDecl type and using argument demotion when necessary. Additional tests in Sema/transparent-union.c capture current behavior and make sure there are no regressions. rdar://problem/34949329 Reviewers: rjmccall, rafael Reviewed By: rjmccall Subscribers: aemerson, cfe-commits, kristof.beyls, ahatanak Differential Revision: https://reviews.llvm.org/D41311 llvm-svn: 323156
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions