static clang::CanQualType getClangDecayedVaListType( const clang::ASTContext &clangCtx) { clang::QualType clangType = clangCtx.getCanonicalType(clangCtx.getBuiltinVaListType()); if (clangType->isConstantArrayType()) clangType = clangCtx.getDecayedType(clangType); return clangCtx.getCanonicalType(clangType); }
static clang::CanQualType getClangMetatypeType( const clang::ASTContext &clangCtx) { clang::QualType clangType = clangCtx.getObjCObjectType(clangCtx.ObjCBuiltinClassTy, 0, 0); clangType = clangCtx.getObjCObjectPointerType(clangType); return clangCtx.getCanonicalType(clangType); }
static clang::CanQualType getClangIdType( const clang::ASTContext &clangCtx) { clang::QualType clangType = clangCtx.getObjCObjectType(clangCtx.ObjCBuiltinIdTy, nullptr, 0); clangType = clangCtx.getObjCObjectPointerType(clangType); return clangCtx.getCanonicalType(clangType); }
static clang::CanQualType getClangVectorType(const clang::ASTContext &ctx, clang::BuiltinType::Kind eltKind, clang::VectorType::VectorKind vecKind, StringRef numEltsString) { unsigned numElts; bool failedParse = numEltsString.getAsInteger<unsigned>(10, numElts); assert(!failedParse && "vector type name didn't end in count?"); (void) failedParse; auto eltTy = getClangBuiltinTypeFromKind(ctx, eltKind); auto vecTy = ctx.getVectorType(eltTy, numElts, vecKind); return ctx.getCanonicalType(vecTy); }