Skip to content

Commit f9b242d

Browse files
committed
[CIR] Merge change to CIRGenTypes::isFuncParamTypeConvertible
Merge in change llvm/clangir@04d7dcf which simplifies function CIRGenTypes::isFuncParamTypeConvertible.
1 parent 666cda9 commit f9b242d

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

clang/lib/CIR/CodeGen/CIRGenTypes.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,8 @@ bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType type) {
3535
if (!tagType)
3636
return true;
3737

38-
// Incomplete types cannot be converted.
39-
if (tagType->isIncompleteType())
40-
return false;
41-
42-
// If this is an enum, then it is always safe to convert.
43-
const RecordType *recordType = dyn_cast<RecordType>(tagType);
44-
if (!recordType)
45-
return true;
46-
47-
// Otherwise, we have to be careful. If it is a struct that we're in the
48-
// process of expanding, then we can't convert the function type. That's ok
49-
// though because we must be in a pointer context under the struct, so we can
50-
// just convert it to a dummy type.
51-
//
52-
// We decide this by checking whether ConvertRecordDeclType returns us an
53-
// opaque type for a struct that we know is defined.
54-
// TODO(cir): struct types are not implemented yet, so skip the final check.
55-
// return isSafeToConvert(recordType->getDecl(), *this);
56-
return true;
38+
// Function types involving incomplete class types are problematic in MLIR.
39+
return !tagType->isIncompleteType();
5740
}
5841

5942
/// Code to verify a given function type is complete, i.e. the return type and

0 commit comments

Comments
 (0)