[PATCH] D33719: Add _Float16 as a C/C++ source language type

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 4 22:33:45 PDT 2017


ahatanak added inline comments.


================
Comment at: include/clang/Basic/TokenKinds.def:379
+// C11 Extension
+KEYWORD(_Float16                    , KEYALL)
+
----------------
Just wanted to confirm that your intention is to unconditionally support _Float16 (for example, c99 supports it too) even though it is a c11 extension. Is that correct?


================
Comment at: lib/Lex/LiteralSupport.cpp:588
+      if (s+1 < ThisTokEnd && s[1] == '1') {
+        if(s+2 < ThisTokEnd && s[2] == '6') {
+          s += 2; // success, eat up 2 tokens.
----------------
Do you want to break out of the switch only when the second digit of the suffix is not 6 (for example, f15)?

I feel this is a bit simpler:

```
if (s + 2 < ThisTokEnd && s[1] == '1' && s[2] == '6')
  s += 2;
```


https://reviews.llvm.org/D33719





More information about the cfe-commits mailing list