File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -922,17 +922,23 @@ JSONBuiltinInterfaceEmitter::TypeDesc::TypeDesc(const Record *T)
922
922
IsPointer(T->getValueAsBit (" IsPointer" )),
923
923
IsConst(T->getValueAsBit (" IsConst" )),
924
924
IsVolatile(T->getValueAsBit (" IsVolatile" )) {
925
+ assert ((!T->getValueAsBit (" IsInteger" ) || !T->getValueAsBit (" IsFloat" )) &&
926
+ " A type can't be both an int and a float" );
925
927
if (T->getValueAsBit (" IsInteger" )) {
926
928
if (ElementSize == 1 )
927
929
ElementType = BOOL;
928
930
else
929
931
ElementType = T->getValueAsBit (" IsSigned" ) ? INT : UINT;
932
+ } else {
933
+ if (T->getValueAsBit (" IsFloat" ))
934
+ ElementType = FLOAT;
935
+ else {
936
+ if (!T->isSubClassOf (" FundamentalType" ) && !T->isSubClassOf (" VectorType" ))
937
+ ElementType = BUILTIN;
938
+ else
939
+ llvm_unreachable (" Invalid type" );
940
+ }
930
941
}
931
- if (T->getValueAsBit (" IsFloat" ))
932
- ElementType = FLOAT;
933
- if (!T->isSubClassOf (" FundamentalType" ) && !T->isSubClassOf (" VectorType" ))
934
- ElementType = BUILTIN;
935
-
936
942
AddrSpace = StringSwitch<const char *>(T->getValueAsString (" AddrSpace" ))
937
943
.Case (" clang::LangAS::Default" , " " )
938
944
.Case (" clang::LangAS::opencl_private" , " __private" )
You can’t perform that action at this time.
0 commit comments