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/Basic | |
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/Basic')
-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; + } }; |