Fix Calling Convention through aliases
authorErich Keane <erich.keane@intel.com>
Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)
commit8a410bcef02c25b6b3a49fa6483875eb64539aad
tree5bc0735b4fa2e26032f327aebacd2fd0d689715c
parente4cec2d3c73f7b30edc03b6b8219273fc81fc477
Fix Calling Convention through aliases

r369697 changed the behavior of stripPointerCasts to no longer include
aliases.  However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.

The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.

Differential Revision: https://reviews.llvm.org/D68584

llvm-svn: 373929
clang/lib/CodeGen/CGDeclCXX.cpp
clang/test/CodeGenCXX/call-conv-thru-alias.cpp [new file with mode: 0644]
llvm/include/llvm/IR/Value.h
llvm/lib/IR/Value.cpp