Give builtins and alloc/dealloc operators the default calling convention.
authorErich Keane <erich.keane@intel.com>
Mon, 4 Mar 2019 14:54:52 +0000 (14:54 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 4 Mar 2019 14:54:52 +0000 (14:54 +0000)
commit881e83d8b94f1997de674ed8ff382a73a29a719d
treedbcdf28beb0ad03330d2fd835b5cdfb2363d17a2
parenteeb1144d27fcb4de8eb4feac113bdc0b70ac0abc
Give builtins and alloc/dealloc operators the default calling convention.

On SPIR targets, the default calling convention is SpirFunction.
However, operator new/delete and builtins were being created with CC_C.
The result is indirect references to new/delete (or builtins that are permitted
to be called indirectly have a mismatched type, as well as questionable codegen
in some cases.

This patch sets both to the default calling convention, so that it
properly matches the calling convention of the target.

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

Change-Id: I52065bb00bc2655945caea8f29c409ba1e0ac24a
llvm-svn: 355317
clang/lib/AST/ASTContext.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/test/CodeGenCXX/builtin-calling-conv.cpp [new file with mode: 0644]