Skip to content

Commit 1c42262

Browse files
committed
Moving removal of 'e' handling to a separate PR
1 parent 4d54f17 commit 1c42262

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clang/include/clang/Basic/Builtins.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
// SJ -> sigjmp_buf
4444
// K -> ucontext_t
4545
// p -> pid_t
46+
// e -> _Float16 for HIP/C++ and __fp16 for OpenCL
4647
// . -> "...". This may only occur at the end of the function list.
4748
//
4849
// Types may be prefixed with the following modifiers:

clang/lib/AST/ASTContext.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12402,8 +12402,12 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context,
1240212402

1240312403
// Read the base type.
1240412404
switch (*Str++) {
12405-
default:
12406-
llvm_unreachable("Unknown builtin type letter!");
12405+
default: llvm_unreachable("Unknown builtin type letter!");
12406+
case 'e':
12407+
assert(HowLong == 0 && !Signed && !Unsigned &&
12408+
"Bad modifiers used with 'e'!");
12409+
Type = Context.getLangOpts().OpenCL ? Context.HalfTy : Context.Float16Ty;
12410+
break;
1240712411
case 'x':
1240812412
assert(HowLong == 0 && !Signed && !Unsigned &&
1240912413
"Bad modifiers used with 'x'!");

0 commit comments

Comments
 (0)