Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible since

it is a predicate, not an action.  Change the return type to be a bool,
not the incomplete member.  Enhace it to detect the recursive compilation
case, allowing us to compile Eli's testcase on llvmdev:

struct T {
 struct T (*p)(void);
} t;

into:

%struct.T = type { {}* }

@t = common global %struct.T zeroinitializer, align 8

llvm-svn: 134853
This commit is contained in:
Chris Lattner
2011-07-10 00:18:59 +00:00
parent 7161661863
commit 8806e32f16
6 changed files with 73 additions and 28 deletions

View File

@@ -2937,7 +2937,8 @@ void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD,
// We can't emit thunks for member functions with incomplete types.
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
if (CGM.getTypes().VerifyFuncTypeComplete(MD->getType().getTypePtr()))
if (!CGM.getTypes().isFuncTypeConvertible(
cast<FunctionType>(MD->getType().getTypePtr())))
return;
EmitThunk(GD, Thunk, /*UseAvailableExternallyLinkage=*/true);