From 3268002d1b7e8e44d78cbf8d4e2fa6b07431cfb4 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 28 Jan 2019 14:10:30 +0000 Subject: Merging r352229: Redirecting to URL 'https://llvm.org/svn/llvm-project/cfe/trunk': ------------------------------------------------------------------------ r352229 | erichkeane | 2019-01-25 19:36:20 +0100 (Fri, 25 Jan 2019) | 7 lines Remove F16 literal support based on Float16 support. Float16 support was disabled recently on many platforms, however that commit still allowed literals of Float16 type to work. This commit removes those based on the same logic as Float16 disable. Change-Id: I72243048ae2db3dc47bd3d699843e3edf9c395ea ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_80@352365 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/LiteralSupport.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/Lex') diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index fa0815eb9c..3c1da075b0 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -617,10 +617,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, if (isHalf || isFloat || isLong || isFloat128) break; // HF, FF, LF, QF invalid. - if (s + 2 < ThisTokEnd && s[1] == '1' && s[2] == '6') { - s += 2; // success, eat up 2 characters. - isFloat16 = true; - continue; + if (PP.getTargetInfo().hasFloat16Type() && s + 2 < ThisTokEnd && + s[1] == '1' && s[2] == '6') { + s += 2; // success, eat up 2 characters. + isFloat16 = true; + continue; } isFloat = true; -- cgit v1.2.3