Skip to content

Commit 04d7dcf

Browse files
committed
[CIR][Types] Mimic OG codegen on isFuncParamTypeConvertible
1 parent c921ec0 commit 04d7dcf

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

clang/lib/CIR/CodeGen/CIRGenTypes.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -321,22 +321,7 @@ bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType Ty) {
321321
return true;
322322

323323
// Incomplete types cannot be converted.
324-
if (TT->isIncompleteType())
325-
return false;
326-
327-
// If this is an enum, then it is always safe to convert.
328-
const RecordType *RT = dyn_cast<RecordType>(TT);
329-
if (!RT)
330-
return true;
331-
332-
// Otherwise, we have to be careful. If it is a struct that we're in the
333-
// process of expanding, then we can't convert the function type. That's ok
334-
// though because we must be in a pointer context under the struct, so we can
335-
// just convert it to a dummy type.
336-
//
337-
// We decide this by checking whether ConvertRecordDeclType returns us an
338-
// opaque type for a struct that we know is defined.
339-
return isSafeToConvert(RT->getDecl(), *this);
324+
return !TT->isIncompleteType();
340325
}
341326

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

0 commit comments

Comments
 (0)