diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-15 19:46:23 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-15 19:46:23 +0000 |
commit | 39d3e7a26c1969fcb76bceb4ee0a410c60ea5954 (patch) | |
tree | 08f17230eab458bd526e3472f2c3ae021980d302 /lib | |
parent | 97d7ff0e514793cb305a1595914f3c91833b4d8f (diff) |
OpenCL: semantic analysis support for cl_khr_fp64 extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaType.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index b6d28cbe71..e69f9dd176 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -671,6 +671,11 @@ static QualType ConvertDeclSpecToType(Sema &S, TypeProcessingState &state) { Result = Context.LongDoubleTy; else Result = Context.DoubleTy; + + if (S.getLangOptions().OpenCL && !S.getOpenCLOptions().cl_khr_fp64) { + S.Diag(DS.getTypeSpecTypeLoc(), diag::err_double_requires_fp64); + declarator.setInvalidType(true); + } break; case DeclSpec::TST_bool: Result = Context.BoolTy; break; // _Bool or bool case DeclSpec::TST_decimal32: // _Decimal32 |