summaryrefslogtreecommitdiff
path: root/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2014-03-18 17:55:18 +0000
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2014-03-18 17:55:18 +0000
commit8cd1d73f00a73eb9fb316b2aa808a153d5aca50c (patch)
tree62457b0b6148a011afbb8fd854acbe592a99d6f2 /lib/Basic/IdentifierTable.cpp
parent23f8716a551f958a767ef980b4276acab4edcd1b (diff)
downloadclang-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/Basic/IdentifierTable.cpp')
-rw-r--r--lib/Basic/IdentifierTable.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 09a0e6bbbd..0993b2335e 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -105,6 +105,7 @@ namespace {
KEYARC = 0x800,
KEYNOMS = 0x01000,
WCHARSUPPORT = 0x02000,
+ HALFSUPPORT = 0x04000,
KEYALL = (0xffff & ~KEYNOMS) // Because KEYNOMS is used to exclude.
};
}
@@ -129,6 +130,7 @@ static void AddKeyword(StringRef Keyword,
else if (LangOpts.MicrosoftExt && (Flags & KEYMS)) AddResult = 1;
else if (LangOpts.Borland && (Flags & KEYBORLAND)) AddResult = 1;
else if (LangOpts.Bool && (Flags & BOOLSUPPORT)) AddResult = 2;
+ else if (LangOpts.Half && (Flags && HALFSUPPORT)) AddResult = 2;
else if (LangOpts.WChar && (Flags & WCHARSUPPORT)) AddResult = 2;
else if (LangOpts.AltiVec && (Flags & KEYALTIVEC)) AddResult = 2;
else if (LangOpts.OpenCL && (Flags & KEYOPENCL)) AddResult = 2;