summaryrefslogtreecommitdiffstats
path: root/clang/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
commitfcdc45ff2df34f38bde572ed3d5d2481edd03deb (patch)
tree71eeda2f28aec4150d29fbf8e845feba10c10412 /clang/lib/Basic/IdentifierTable.cpp
parenta9dafe679319112d26c1d2edb1bb26952c2983db (diff)
downloadbcm5719-llvm-fcdc45ff2df34f38bde572ed3d5d2481edd03deb.tar.gz
bcm5719-llvm-fcdc45ff2df34f38bde572ed3d5d2481edd03deb.zip
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 llvm-svn: 204164
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 09a0e6bbbdc..0993b2335e4 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud