From 21de0ae3d45ea34f924b5c8b19249852155d9929 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Tue, 20 Jan 2015 11:20:41 +0000 Subject: Re-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558. The test was fixed after a discussion with the revision author: the check pattern was made more flexible as the "%call" part is not what we actually want to check strictly there. The original patch description: === Introduce SPIR calling conventions. This implements Section 3.7 from the SPIR 1.2 spec: SPIR kernels should use "spir_kernel" calling convention. Non-kernel functions use "spir_func" calling convention. All other calling conventions are disallowed. The patch works only for OpenCL source. Any other uses will need to ensure that kernels are assigned the spir_kernel calling convention correctly. === llvm-svn: 226561 --- clang/lib/AST/ASTContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 7f17fe8b8cc..c1bbc5f085f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -8043,7 +8043,9 @@ CallingConv ASTContext::getDefaultCallingConvention(bool IsVariadic, if (IsCXXMethod) return ABI->getDefaultMethodCallConv(IsVariadic); - return (LangOpts.MRTD && !IsVariadic) ? CC_X86StdCall : CC_C; + if (LangOpts.MRTD && !IsVariadic) return CC_X86StdCall; + + return Target->getDefaultCallingConv(TargetInfo::CCMT_Unknown); } bool ASTContext::isNearlyEmpty(const CXXRecordDecl *RD) const { -- cgit v1.2.3