diff options
author | Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> | 2015-01-20 06:44:32 +0000 |
---|---|---|
committer | Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> | 2015-01-20 06:44:32 +0000 |
commit | 450a58b8afbc1790bb58412de5bf0eaa9c599666 (patch) | |
tree | d283328cd3c84234f28de0a90d657dd43776342a /clang/lib/Basic/Targets.cpp | |
parent | 0b0f4660faa5072aa5f75560722f224b9712629c (diff) | |
download | bcm5719-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/Basic/Targets.cpp')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 9aac3b78643..476217146ed 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -6346,6 +6346,15 @@ namespace { BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::VoidPtrBuiltinVaList; } + + CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { + return (CC == CC_SpirFunction || + CC == CC_SpirKernel) ? CCCR_OK : CCCR_Warning; + } + + CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override { + return CC_SpirFunction; + } }; |