diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-01-20 11:20:41 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-01-20 11:20:41 +0000 |
commit | 21de0ae3d45ea34f924b5c8b19249852155d9929 (patch) | |
tree | 38412fd21e4ede299c9bf7861005ea882aa31a39 /clang/lib/AST/ASTContext.cpp | |
parent | aaf0b4cd57c609b33c2c12adc5d0ca109c8e6131 (diff) | |
download | bcm5719-llvm-21de0ae3d45ea34f924b5c8b19249852155d9929.tar.gz bcm5719-llvm-21de0ae3d45ea34f924b5c8b19249852155d9929.zip |
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
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |