CanQualType HalfTy; // [OpenCL 6.1.1.1], ARM NEON
CanQualType BFloat16Ty;
CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
- CanQualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy;
- CanQualType Float128ComplexTy;
CanQualType VoidPtrTy, NullPtrTy;
CanQualType DependentTy, OverloadTy, BoundMemberTy, UnknownAnyTy;
CanQualType BuiltinFnTy;
if (LangOpts.MatrixTypes)
InitBuiltinType(IncompleteMatrixIdxTy, BuiltinType::IncompleteMatrixIdx);
- // C99 6.2.5p11.
- FloatComplexTy = getComplexType(FloatTy);
- DoubleComplexTy = getComplexType(DoubleTy);
- LongDoubleComplexTy = getComplexType(LongDoubleTy);
- Float128ComplexTy = getComplexType(Float128Ty);
-
// Builtin types for 'id', 'Class', and 'SEL'.
InitBuiltinType(ObjCBuiltinIdTy, BuiltinType::ObjCId);
InitBuiltinType(ObjCBuiltinClassTy, BuiltinType::ObjCClass);
case Float16Rank:
case HalfRank: llvm_unreachable("Complex half is not supported");
case Ibm128Rank: llvm_unreachable("Complex __ibm128 is not supported");
- case FloatRank: return FloatComplexTy;
- case DoubleRank: return DoubleComplexTy;
- case LongDoubleRank: return LongDoubleComplexTy;
- case Float128Rank: return Float128ComplexTy;
+ case FloatRank: return getComplexType(FloatTy);
+ case DoubleRank: return getComplexType(DoubleTy);
+ case LongDoubleRank: return getComplexType(LongDoubleTy);
+ case Float128Rank: return getComplexType(Float128Ty);
}
}
}
break;
- case DW_ATE_complex_float:
- if (QualTypeMatchesBitSize(bit_size, ast, ast.FloatComplexTy))
- return GetType(ast.FloatComplexTy);
- else if (QualTypeMatchesBitSize(bit_size, ast, ast.DoubleComplexTy))
- return GetType(ast.DoubleComplexTy);
- else if (QualTypeMatchesBitSize(bit_size, ast, ast.LongDoubleComplexTy))
- return GetType(ast.LongDoubleComplexTy);
- else {
- CompilerType complex_float_clang_type =
- GetBuiltinTypeForDWARFEncodingAndBitSize("float", DW_ATE_float,
- bit_size / 2);
- return GetType(
- ast.getComplexType(ClangUtil::GetQualType(complex_float_clang_type)));
- }
- break;
+ case DW_ATE_complex_float: {
+ CanQualType FloatComplexTy = ast.getComplexType(ast.FloatTy);
+ if (QualTypeMatchesBitSize(bit_size, ast, FloatComplexTy))
+ return GetType(FloatComplexTy);
+
+ CanQualType DoubleComplexTy = ast.getComplexType(ast.DoubleTy);
+ if (QualTypeMatchesBitSize(bit_size, ast, DoubleComplexTy))
+ return GetType(DoubleComplexTy);
+
+ CanQualType LongDoubleComplexTy = ast.getComplexType(ast.LongDoubleTy);
+ if (QualTypeMatchesBitSize(bit_size, ast, LongDoubleComplexTy))
+ return GetType(LongDoubleComplexTy);
+
+ CompilerType complex_float_clang_type =
+ GetBuiltinTypeForDWARFEncodingAndBitSize("float", DW_ATE_float,
+ bit_size / 2);
+ return GetType(
+ ast.getComplexType(ClangUtil::GetQualType(complex_float_clang_type)));
+ }
case DW_ATE_float:
if (type_name == "float" &&
case eBasicTypeLongDouble:
return ast->LongDoubleTy.getAsOpaquePtr();
case eBasicTypeFloatComplex:
- return ast->FloatComplexTy.getAsOpaquePtr();
+ return ast->getComplexType(ast->FloatTy).getAsOpaquePtr();
case eBasicTypeDoubleComplex:
- return ast->DoubleComplexTy.getAsOpaquePtr();
+ return ast->getComplexType(ast->DoubleTy).getAsOpaquePtr();
case eBasicTypeLongDoubleComplex:
- return ast->LongDoubleComplexTy.getAsOpaquePtr();
+ return ast->getComplexType(ast->LongDoubleTy).getAsOpaquePtr();
case eBasicTypeObjCID:
return ast->getObjCIdType().getAsOpaquePtr();
case eBasicTypeObjCClass:
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeDouble),
context.DoubleTy));
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeDoubleComplex),
- context.DoubleComplexTy));
+ context.getComplexType(context.DoubleTy)));
EXPECT_TRUE(
context.hasSameType(GetBasicQualType(eBasicTypeFloat), context.FloatTy));
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeFloatComplex),
- context.FloatComplexTy));
+ context.getComplexType(context.FloatTy)));
EXPECT_TRUE(
context.hasSameType(GetBasicQualType(eBasicTypeHalf), context.HalfTy));
EXPECT_TRUE(
context.hasSameType(GetBasicQualType(eBasicTypeLong), context.LongTy));
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeLongDouble),
context.LongDoubleTy));
- EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeLongDoubleComplex),
- context.LongDoubleComplexTy));
+ EXPECT_TRUE(
+ context.hasSameType(GetBasicQualType(eBasicTypeLongDoubleComplex),
+ context.getComplexType(context.LongDoubleTy)));
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeLongLong),
context.LongLongTy));
EXPECT_TRUE(context.hasSameType(GetBasicQualType(eBasicTypeNullPtr),