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/Frontend/CompilerInvocation.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/Frontend/CompilerInvocation.cpp')
| -rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 7cc0b1bee3..79d81511c3 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1116,6 +1116,9 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, // OpenCL and C++ both have bool, true, false keywords. Opts.Bool = Opts.OpenCL || Opts.CPlusPlus; + // OpenCL has half keyword + Opts.Half = Opts.OpenCL; + // C++ has wchar_t keyword. Opts.WChar = Opts.CPlusPlus; |
