summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2015-01-20 06:44:32 +0000
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2015-01-20 06:44:32 +0000
commit450a58b8afbc1790bb58412de5bf0eaa9c599666 (patch)
treed283328cd3c84234f28de0a90d657dd43776342a /clang/lib/AST/ASTContext.cpp
parent0b0f4660faa5072aa5f75560722f224b9712629c (diff)
downloadbcm5719-llvm-450a58b8afbc1790bb58412de5bf0eaa9c599666.tar.gz
bcm5719-llvm-450a58b8afbc1790bb58412de5bf0eaa9c599666.zip
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: 226548
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp4
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 {
OpenPOWER on IntegriCloud