[clang] [clang] Add `__bf16` Type Support Macros With Literal Suffix Support (PR #134214)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 4 02:40:29 PDT 2025
================
@@ -978,6 +979,24 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling,
// we break out of the loop.
for (; s != ThisTokEnd; ++s) {
switch (*s) {
+ case 'b': // FP Suffix for "__bf16"
+ case 'B':
+ if (!Target.hasBFloat16Type())
+ break;
+ if (!isFPConstant)
+ break; // Error for integer constant.
+ if (HasSize)
+ break;
+ HasSize = true;
+
+ if ((Target.hasBFloat16Type()) && s + 3 < ThisTokEnd &&
----------------
overmighty wrote:
We already have `if (!Target.hasBFloat16Type()) break;` above.
```suggestion
```
https://github.com/llvm/llvm-project/pull/134214
More information about the cfe-commits
mailing list