diff options
author | Joey Gouly <joey.gouly@arm.com> | 2013-01-23 11:56:20 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@arm.com> | 2013-01-23 11:56:20 +0000 |
commit | 19dbb20ac4371fae3190379a7e7bd467af3c00aa (patch) | |
tree | 4ad0ff118896e57acd79d0f76e8a57311af4bd19 /lib/Sema/SemaOverload.cpp | |
parent | 218b6dfaee321cec558e15d47b68155dd9f35684 (diff) |
Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).
Also add some semantic checks for OpenCL half types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index d3d027b8a5..b91b027ba0 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -1840,7 +1840,8 @@ bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) { return true; // Half can be promoted to float. - if (FromBuiltin->getKind() == BuiltinType::Half && + if (!getLangOpts().NativeHalfType && + FromBuiltin->getKind() == BuiltinType::Half && ToBuiltin->getKind() == BuiltinType::Float) return true; } |