diff options
| author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2014-03-18 17:55:18 +0000 |
|---|---|---|
| committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2014-03-18 17:55:18 +0000 |
| commit | 8cd1d73f00a73eb9fb316b2aa808a153d5aca50c (patch) | |
| tree | 62457b0b6148a011afbb8fd854acbe592a99d6f2 /lib/AST/Type.cpp | |
| parent | 23f8716a551f958a767ef980b4276acab4edcd1b (diff) | |
| download | clang-8cd1d73f00a73eb9fb316b2aa808a153d5aca50c.tar.gz clang-8cd1d73f00a73eb9fb316b2aa808a153d5aca50c.tar.bz2 clang-8cd1d73f00a73eb9fb316b2aa808a153d5aca50c.tar.xz | |
Creating a printing policy for "half":
Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for
other languages, error messages and metadata (and hence debug info) should refer
to the half-precision floating point as "__fp16" instead of "half" when
compiling for non-OpenCL languages. This patch creates a new printing policy for
half in a similar manner to what is done for bool and wchar_t.
Differential Revision: http://llvm-reviews.chandlerc.com/D2952
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
| -rw-r--r-- | lib/AST/Type.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 32e7b020d5..dc3fcc8c78 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1523,7 +1523,7 @@ StringRef BuiltinType::getName(const PrintingPolicy &Policy) const { case ULong: return "unsigned long"; case ULongLong: return "unsigned long long"; case UInt128: return "unsigned __int128"; - case Half: return "half"; + case Half: return Policy.Half ? "half" : "__fp16"; case Float: return "float"; case Double: return "double"; case LongDouble: return "long double"; |
