================ @@ -18,6 +21,87 @@ mlir::MLIRContext &CIRGenTypes::getMLIRContext() const { return *builder.getContext(); } +/// Return true if the specified type in a function parameter or result position +/// can be converted to a CIR type at this point. This boils down to being +/// whether it is complete, as well as whether we've temporarily deferred +/// expanding the type because we're in a recursive context. +bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType type) { + // Some ABIs cannot have their member pointers represented in LLVM IR unless + // certain circumstances have been reached. + assert(!type->getAs<MemberPointerType>() && "NYI"); + + // If this isn't a tagged type, we can convert it! ---------------- dkolsen-pgi wrote:
This function is used to check if a type is problematic when it is used as part of a function type. According to the comment here, only incomplete `class`/`struct`/`union` types are problematic when creating ClangIR function types. The currently upstreamed ClangIR code can't handle atomic types or vector types or some of the other types you mentioned, in any context. But when ClangIR can handle them, they will just work as part of function types; the code here won't need to change. This entire function could have been left out of this PR since it doesn't do anything useful yet. But because everything in the function except for the last line builds and runs, I decided to include it in this PR. https://github.com/llvm/llvm-project/pull/120484 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits