Skip to content

Commit

Permalink
[CIR][Types] Mimic OG codegen on isFuncParamTypeConvertible
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardosolopes committed Dec 20, 2024
1 parent c921ec0 commit 04d7dcf
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions clang/lib/CIR/CodeGen/CIRGenTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,22 +321,7 @@ bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType Ty) {
return true;

// Incomplete types cannot be converted.
if (TT->isIncompleteType())
return false;

// If this is an enum, then it is always safe to convert.
const RecordType *RT = dyn_cast<RecordType>(TT);
if (!RT)
return true;

// Otherwise, we have to be careful. If it is a struct that we're in the
// process of expanding, then we can't convert the function type. That's ok
// though because we must be in a pointer context under the struct, so we can
// just convert it to a dummy type.
//
// We decide this by checking whether ConvertRecordDeclType returns us an
// opaque type for a struct that we know is defined.
return isSafeToConvert(RT->getDecl(), *this);
return !TT->isIncompleteType();
}

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

0 comments on commit 04d7dcf

Please sign in to comment.