[clang] [CIR] floating-point, pointer, and function types (PR #120484)
David Olsen via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 19 08:25:17 PST 2024
================
@@ -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:
> rather than returning a value we wouldn't be sure of.
That wouldn't be the case. The ClangIR incubator project already implements type conversions for virtually all types. It is known that incomplete tag types are the only ones that are problematic in this context. We already know that all non-tag types are fine.
This function is making assumptions based on code that is in the incubator project but hasn't been upstreamed yet. I am trying to minimize that, of course. But eliminating those assumptions entirely would slow down the upstreaming work even more, for no tangible benefit for the end result.
https://github.com/llvm/llvm-project/pull/120484
More information about the cfe-commits
mailing list